SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2101.02477 · ICCV · 2021

GAN-Control: Explicitly Controllable GANs

Alon Shoshan, Nadav Bhonker, Igor Kviatkovsky, Gérard Medioni

arXiv · PDF · Open in the Atlas

Code that ran

7 of 14 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 6 have no contract verdict; 1 failure of our instrument; 7 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2101.02477.json · badge: /api/ran/2101.02477.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
amazon-research/gan-control marked official in Papers with Code
Papers with Code archive
7 ran · 7 no recorded run
FunctionStatusWhere it lives
ConstantInput Ran
ran on a synthesized input
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("33370da85dde116b")
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, 8, 4, 4) 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
from torch import nn

class ConstantInput(nn.Module):

    def __init__(self, channel, size=4):
        super().__init__()
        self.input = nn.Parameter(torch.randn(1, channel, size, size))

    def forward(self, input):
        batch = input.shape[0]
        out = self.input.repeat(batch, 1, 1, 1)
        return out


INIT_ARGS = {
    'channel': 8,
    'size': 4
}

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

model = ConstantInput(**INIT_ARGS)
output = model(**ARGS)
print(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, 8, 4, 4) — shape (2, 8, 4, 4) 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)
EqualLinear Ran
ran on a synthesized input
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("3c50af22dfad4436")
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 2, dtype family float, shape (2, 3) 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 math
import torch
from torch import nn
from torch.nn import functional as F

class EqualLinear(nn.Module):

    def __init__(self, in_dim, out_dim, bias=True, bias_init=0, lr_mul=1, activation=None):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(out_dim, in_dim).div_(lr_mul))
        if bias:
            self.bias = nn.Parameter(torch.zeros(out_dim).fill_(bias_init))
        else:
            self.bias = None
        self.activation = activation
        self.scale = 1 / math.sqrt(in_dim) * lr_mul
        self.lr_mul = lr_mul

    def forward(self, input):
        if self.activation:
            out = F.linear(input, self.weight * self.scale)
            out = self._fused_leaky_relu(out, self.bias * self.lr_mul)
        else:
            out = F.linear(input, self.weight * self.scale, bias=self.bias * self.lr_mul)
        return out

    def _fused_leaky_relu(self, input, bias):
        return F.leaky_relu(input + bias, negative_slope=0.2)

    def __repr__(self):
        return f'{self.__class__.__name__}({self.weight.shape[1]}, {self.weight.shape[0]})'


INIT_ARGS = {
    'in_dim': 4,
    'out_dim': 3,
    'bias': True,
    'bias_init': 0,
    'lr_mul': 1,
    'activation': None
}

ARGS = {
    'input': torch.randn(2, 4)
}
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 2, dtype family float, shape (2, 3) — shape (2, 3) 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)
ModulatedNoiseInjection Ran
ran on a synthesized input
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("5313be2f6108140e")
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, 8, 4, 3) 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
from torch import nn

class ModulatedNoiseInjection(nn.Module):

    def __init__(self, zeros=False, id_zeros=False):
        super().__init__()
        self.zeros = zeros
        self.id_zeros = id_zeros
        self.weight = nn.Parameter(torch.zeros(1))

    def forward(self, image, noise=None):
        if self.zeros:
            return image
        elif self.id_zeros:
            if noise is None:
                batch, _, height, width = image.shape
                noise = image.new_empty(batch, 1, height, width).normal_()
            image_pose, image_id = torch.chunk(image, 2, dim=1)
            return torch.cat([image_pose + self.weight * noise, image_id], dim=1)


INIT_ARGS = {
    'zeros': False,
    'id_zeros': True,
}

ARGS = {
    'image': torch.randn(2, 8, 4, 3),
    'noise': None,
}

if __name__ == '__main__':
    module = ModulatedNoiseInjection(**INIT_ARGS)
    output = module(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
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, 8, 4, 3) — shape (2, 8, 4, 3) 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)
MultiFcStack Ran
ran on a synthesized input
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("85a522397f0921be")
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 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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
from torch import nn

class SimpleConfig:
    def __init__(self, in_order_group_names, groups):
        self.in_order_group_names = in_order_group_names
        self.groups = groups

# Define the configuration
in_order_group_names = ['group_a', 'group_b', 'group_c']

groups = {
    'group_a': {'latent_place': (0, 3)},
    'group_b': {'latent_place': (3, 7)},
    'group_c': {'latent_place': (7, 11)}
}

fc_config = SimpleConfig(in_order_group_names, groups)

# Create fc_dict with small linear layers
fc_dict = {
    'group_a': nn.Linear(3, 5),
    'group_b': nn.Linear(4, 6),
    'group_c': nn.Linear(4, 7)
}

INIT_ARGS = {
    'fc_dict': fc_dict,
    'fc_config': fc_config
}

# Input tensor with batch size 2 and feature dimension 11 (matching the latent_place ranges)
x = torch.randn(2, 11)

ARGS = {
    'x': x
}
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 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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)
NoiseInjection Ran
ran on a synthesized input
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("7efd91b0a334f2d5")
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, 3, 4, 5) 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
from torch import nn

class NoiseInjection(nn.Module):

    def __init__(self):
        super().__init__()
        self.weight = nn.Parameter(torch.zeros(1))

    def forward(self, image, noise=None):
        if noise is None:
            batch, _, height, width = image.shape
            noise = image.new_empty(batch, 1, height, width).normal_()
        return image + self.weight * noise


INIT_ARGS = {}

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

if __name__ == '__main__':
    module = NoiseInjection(**INIT_ARGS)
    output = module(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
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, 3, 4, 5) — shape (2, 3, 4, 5) 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)
PixelNorm Ran
ran on a synthesized input
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("22b9cf66e3565c1e")
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 2, dtype family float, shape (2, 4) 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
from torch import nn

class PixelNorm(nn.Module):

    def __init__(self):
        super().__init__()

    def forward(self, input):
        return input * torch.rsqrt(torch.mean(input ** 2, dim=1, keepdim=True) + 1e-08)


INIT_ARGS = {}

ARGS = {
    'input': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = PixelNorm(**INIT_ARGS)
    output = model(**ARGS)
    print(output)
    print(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 2, dtype family float, shape (2, 4) — shape (2, 4) 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)
get_logger Ran
ran; our contract draft was wrong, not the code
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("86dcd3deaf9ad8a8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Logger. The image it ran in was not recorded. If your copy returns the same type 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 logging

ARGS = {
    "name": "test_logger"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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: none by the harness; any seed is in the setup block
Blur Not yet run
unverified (harvested, no recorded run)
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("85ab6052faa2dbba")
How it ran

no invocation recorded.

Generator Not yet run
unverified (harvested, no recorded run)
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("f3552a33f3b24bd7")
How it ran

no invocation recorded.

ModulatedConv2d Not yet run
unverified (harvested, no recorded run)
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("771ce08f61fae945")
How it ran

no invocation recorded.

StyledConv Not yet run
unverified (harvested, no recorded run)
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("1259fbf2a39f45d5")
How it ran

no invocation recorded.

ToRGB Not yet run
unverified (harvested, no recorded run)
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("75858659b1e987d6")
How it ran

no invocation recorded.

Upsample Not yet run
unverified (harvested, no recorded run)
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("2308d2ca68ca25f9")
How it ran

no invocation recorded.

VAE Not yet run
unverified (harvested, no recorded run)
amazon-research/gan-control/src/gan_control/models/gan_model.py
code served (permissive licence) · get_code("93eaf4fe3baa5c5d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 6 later) and 8 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.

FunctionAlso present inEarliest-datedOthers named
Blur
brick of this paper's assembly: helper
10 other papers
1 dated earlier, 9 later · 4 only as an assembly brick
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2103.17249 (2021-03)
StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
2104.06820 (2021-04)
Few-shot Image Generation via Cross-domain Correspondence
and 7 more not named here
NoiseInjection
brick of this paper's assembly: model
9 other papers
1 dated earlier, 8 later · 7 only as an assembly brick
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2103.17249 (2021-03)
StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
2104.06820 (2021-04)
Few-shot Image Generation via Cross-domain Correspondence
and 6 more not named here
ConstantInput
brick of this paper's assembly: helper
8 other papers
1 dated earlier, 7 later · 5 only as an assembly brick
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2103.17249 (2021-03)
StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
2104.06820 (2021-04)
Few-shot Image Generation via Cross-domain Correspondence
and 5 more not named here
EqualLinear
brick of this paper's assembly: model
8 other papers
1 dated earlier, 7 later
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2103.17249 (2021-03)
StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
2104.02699 (2021-04)
ReStyle: A Residual-Based StyleGAN Encoder via Iterative Refinement
and 5 more not named here
PixelNorm
brick of this paper's assembly: helper
8 other papers
1 dated earlier, 7 later · 6 only as an assembly brick
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2103.17249 (2021-03)
StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
2104.06820 (2021-04)
Few-shot Image Generation via Cross-domain Correspondence
and 5 more not named here
Upsample
brick of this paper's assembly: helper
8 other papers
1 dated earlier, 7 later · 3 only as an assembly brick
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2103.17249 (2021-03)
StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
2104.06820 (2021-04)
Few-shot Image Generation via Cross-domain Correspondence
and 5 more not named here

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-21.

Repositories linked to this paper

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

Abstract

We propose a framework for training GANs in a disentangled manner which allows for explicit control over generation attributes. Our method is applicable to diverse controls in various domains. First row (left to right) demonstrates our control over facial expression, age and illumination of human portraits. Second row (left to right) demonstrates our control over artistic style, age and pose of paintings. Third row demonstrates our pose control over faces of dogs.

For agents

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

get_harvested_code_for_paper("2101.02477")
get_code_for_paper("2101.02477")
have("2101.02477")

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

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

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

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

Connect an agent — have() is free.