SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.07432 · ICLR · 2021

Viewmaker Networks: Learning Views for Unsupervised Representation Learning

Alex Tamkin, Mike Wu, Noah Goodman

arXiv · PDF · Open in the Atlas

Code that ran

2 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2010.07432.json · badge: /api/ran/2010.07432.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
alextamkin/viewmaker canonical (classifier label)
classifier basis: classifier_2025
2 ran · 2 no recorded run
FunctionStatusWhere it lives
ResidualBlock Ran
ran on a synthesized input
alextamkin/viewmaker/src/models/viewmaker.py
code served (permissive licence) · get_code("4da8362d3e062176")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 16, 8, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

INIT_ARGS = {
    'channels': 16,
    'activation': 'relu',
}

ARGS = {
    'x': torch.randn(2, 16, 8, 8),
}

# Construct and call
residual_block = torch.nn.Module()
residual_block.__class__ = type('ResidualBlock', (torch.nn.Module,), {
    '__init__': lambda self, channels, activation='relu': (
        super(type(self), self).__init__(),
        setattr(self, 'conv1', type('ConvLayer', (torch.nn.Module,), {
            '__init__': lambda s, in_c, out_c, k, st: (
                super(type(s), s).__init__(),
                setattr(s, 'reflection_pad', torch.nn.ReflectionPad2d(k // 2)),
                setattr(s, 'conv2d', torch.nn.Conv2d(in_c, out_c, k, st)),
            ),
            'forward': lambda s, x: s.conv2d(s.reflection_pad(x)),
        })(channels, channels, 3, 1)),
        setattr(self, 'in1', torch.nn.InstanceNorm2d(channels, affine=True)),
        setattr(self, 'conv2', type('ConvLayer', (torch.nn.Module,), {
            '__init__': lambda s, in_c, out_c, k, st: (
                super(type(s), s).__init__(),
                setattr(s, 'reflection_pad', torch.nn.ReflectionPad2d(k // 2)),
                setattr(s, 'conv2d', torch.nn.Conv2d(in_c, out_c, k, st)),
            ),
            'forward': lambda s, x: s.conv2d(s.reflection_pad(x)),
        })(channels, channels, 3, 1)),
        setattr(self, 'in2', torch.nn.InstanceNorm2d(channels, affine=True)),
        setattr(self, 'act', torch.nn.ReLU() if activation == 'relu' else torch.nn.LeakyReLU()),
    ),
    'forward': lambda self, x: (
        lambda residual, out: out + residual
    )(x, self.in2(self.conv2(self.act(self.in1(self.conv1(x)))))),
})

ACTIVATIONS = {'relu': torch.nn.ReLU, 'leaky_relu': torch.nn.LeakyReLU}

class ConvLayer(torch.nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size, stride):
        super(ConvLayer, self).__init__()
        reflection_padding = kernel_size // 2
        self.reflection_pad = torch.nn.ReflectionPad2d(reflection_padding)
        self.conv2d = torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride)

    def forward(self, x):
        out = self.reflection_pad(x)
        out = self.conv2d(out)
        return out

class ResidualBlock(torch.nn.Module):
    def __init__(self, channels, activation='relu'):
        super(ResidualBlock, self).__init__()
        self.conv1 = ConvLayer(channels, channels, kernel_size=3, stride=1)
        self.in1 = torch.nn.InstanceNorm2d(channels, affine=True)
        self.conv2 = ConvLayer(channels, channels, kernel_size=3, stride=1)
        self.in2 = torch.nn.InstanceNorm2d(channels, affine=True)
        self.act = ACTIVATIONS[activation]()

    def forward(self, x):
        residual = x
        out = self.act(self.in1(self.conv1(x)))
        out = self.in2(self.conv2(out))
        out = out + residual
        return out

model = ResidualBlock(**INIT_ARGS)
output = model(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 16, 8, 8) — shape (2, 16, 8, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
UpsampleConvLayer Ran
ran on a synthesized input
alextamkin/viewmaker/src/models/viewmaker.py
code served (permissive licence) · get_code("e321b20a17ec6cd5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 16, 8, 10) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

INIT_ARGS = {
    'in_channels': 3,
    'out_channels': 16,
    'kernel_size': 3,
    'stride': 1,
    'upsample': 2
}

ARGS = {
    'x': torch.randn(2, 3, 4, 5)
}

if __name__ == '__main__':
    layer = torch.nn.Module.__new__(type(
        'UpsampleConvLayer',
        (torch.nn.Module,),
        {
            '__init__': lambda self, in_channels, out_channels, kernel_size, stride, upsample=None: (
                torch.nn.Module.__init__(self),
                setattr(self, 'upsample', upsample),
                setattr(self, 'reflection_pad', torch.nn.ReflectionPad2d(kernel_size // 2)),
                setattr(self, 'conv2d', torch.nn.Conv2d(in_channels, out_channels, kernel_size, stride))
            ),
            'forward': lambda self, x: (
                torch.nn.functional.interpolate(x, mode='nearest', scale_factor=self.upsample) if self.upsample else x,
                self.reflection_pad(torch.nn.functional.interpolate(x, mode='nearest', scale_factor=self.upsample) if self.upsample else x),
                self.conv2d(self.reflection_pad(torch.nn.functional.interpolate(x, mode='nearest', scale_factor=self.upsample) if self.upsample else x))
            )[-1]
        }
    ))
    
    layer.__init__(**INIT_ARGS)
    output = layer(**ARGS)
    print(f"Output shape: {output.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 16, 8, 10) — shape (2, 16, 8, 10) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ConvLayer Not yet run
unverified (harvested, no recorded run)
alextamkin/viewmaker/src/models/viewmaker.py
code served (permissive licence) · get_code("67783a27261dfc0c")
How it ran

no invocation recorded.

Viewmaker Not yet run
unverified (harvested, no recorded run)
alextamkin/viewmaker/src/models/viewmaker.py
code served (permissive licence) · get_code("5384d367de48bdaa")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Many recent methods for unsupervised representation learning train models to be invariant to different "views," or distorted versions of an input. However, designing these views requires considerable trial and error by human experts, hindering widespread adoption of unsupervised representation learning methods across domains and modalities. To address this, we propose viewmaker networks: generative models that learn to produce useful views from a given input. Viewmakers are stochastic bounded adversaries: they produce views by generating and then adding an p -bounded perturbation to the input, and are trained adversarially with respect to the main encoder network. Remarkably, when pretraining on CIFAR-10, our learned views enable comparable transfer accuracy to the well-tuned SimCLR augmentations-despite not including transformations like cropping or color jitter. Furthermore, our learned views significantly outperform baseline augmentations on speech recordings (+9% points, on average) and wearable sensor data (+17% points). Viewmakers can also be combined with handcrafted views: they improve robustness to common image corruptions and can increase transfer performance in cases where handcrafted views are less explored. These results suggest that viewmakers may provide a path towards more general representation learning algorithms-reducing the domain expertise and effort needed to pretrain on a much wider set of domains. Code is available at https://github.com/alextamkin/viewmaker. Figure 1: Viewmaker networks generate complex and diverse input-dependent views for unsupervised learning. Examples shown are for CIFAR-10. Original image in center with pink border.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2010.07432")
get_code_for_paper("2010.07432")
have("2010.07432")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2010.07432.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2010.07432.svg)](https://syntology.ai/paper/2010.07432)

Connect an agent — have() is free.