SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.00048 · ICLR · 2023

PandA: Unsupervised Learning of Parts and Appearances in the Feature Maps of GANs

Yannis Panagakis, James Oldfield, Christos Tzelepis, Mihalis Nicolaou, Ioannis Patras

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 5 failures of our instrument; 5 no recorded run), measured 2026-11-23; 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/2206.00048.json · badge: /api/ran/2206.00048.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
james-oldfield/PandA canonical (classifier label)
classifier basis not recorded on the link
9 ran · 5 no recorded run
FunctionStatusWhere it lives
construct_heatmap Ran
ran; our contract draft was wrong, not the code
james-oldfield/PandA/networks/stylegan3/avg_spectra.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from PDillis/stylegan3-fun, is pointer only (licence: NOASSERTION) · get_code("260d293a46551cc2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from PDillis/stylegan3-fun, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

convert_to_images Ran
ran on a synthesized input
james-oldfield/PandA/networks/biggan/utils.py
code served (permissive licence) · get_code("a57f16b653411188")
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, through the batch API) and returned list, ndim 4, dtype family int; 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
import numpy as np

torch.manual_seed(0)

# Create a small tensor representing BigGAN output
# Shape: (batch_size=2, channels=3, height=4, width=5)
# Values in range [-1, 1] as typical for GAN outputs
tensor_output = torch.randn(2, 3, 4, 5) * 0.5

ARGS = {
    "obj": tensor_output
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 4, dtype family int — a list output has no array shape of its own; none is stated
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: none by the harness; any seed is in the setup block
mapRange Ran
ran on a synthesized input
james-oldfield/PandA/utils.py
code served (permissive licence) · get_code("de4a9b04038c13d9")
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, through the batch API) and returned float, ndim 0, dtype family float, shape () 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
import numpy as np

torch.manual_seed(0)

# mapRange maps a value from input range [inMin, inMax] to output range [outMin, outMax]
# It uses basic arithmetic operations: subtraction, division, multiplication, addition

# Create simple numeric arguments
value = 5.0
inMin = 0.0
inMax = 10.0
outMin = 0.0
outMax = 100.0

ARGS = {
    "value": value,
    "inMin": inMin,
    "inMax": inMax,
    "outMin": outMin,
    "outMax": outMax
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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: none by the harness; any seed is in the setup block
one_hot_from_int Ran
ran on a synthesized input
james-oldfield/PandA/networks/biggan/utils.py
code served (permissive licence) · get_code("2baf0e56dad23fd6")
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, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (3, 1000) 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 numpy as np

NUM_CLASSES = 1000

def one_hot_from_int(int_or_list, batch_size=1):
    """ Create a one-hot vector from a class index or a list of class indices.
        Params:
            int_or_list: int, or list of int, of the imagenet classes (between 0 and 999)
            batch_size: batch size.
                If int_or_list is an int create a batch of identical classes.
                If int_or_list is a list, we should have `len(int_or_list) == batch_size`
        Output:
            array of shape (batch_size, 1000)
    """
    if isinstance(int_or_list, int):
        int_or_list = [int_or_list]
    if len(int_or_list) == 1 and batch_size > 1:
        int_or_list = [int_or_list[0]] * batch_size
    assert batch_size == len(int_or_list)
    array = np.zeros((batch_size, NUM_CLASSES), dtype=np.float32)
    for i, j in enumerate(int_or_list):
        array[i, j] = 1.0
    return array


# Test case 1: Single int with batch_size > 1
ARGS = {
    "int_or_list": 42,
    "batch_size": 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 1000) — shape (3, 1000) 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: none by the harness; any seed is in the setup block
sn_embedding Ran
ran; our contract draft was wrong, not the code
james-oldfield/PandA/networks/biggan/model.py
code served (permissive licence) · get_code("abed13633552f3d0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Embedding. 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 torch
import torch.nn as nn

torch.manual_seed(0)

# The function sn_embedding takes eps and **kwargs
# The **kwargs are passed to nn.Embedding
# nn.Embedding requires num_embeddings and embedding_dim at minimum

ARGS = {
    'eps': 1e-12,
    'num_embeddings': 10,
    'embedding_dim': 4
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Embedding — a Embedding output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Embedding 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
snconv2d Ran
ran; our contract draft was wrong, not the code
james-oldfield/PandA/networks/biggan/model.py
code served (permissive licence) · get_code("b76bf7615e32c07d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Conv2d. 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 torch
import torch.nn as nn

torch.manual_seed(0)

# snconv2d creates a spectral normalized Conv2d
# We need to provide kwargs for nn.Conv2d and eps for spectral_norm

# nn.Conv2d required parameters: in_channels, out_channels, kernel_size
# Common optional parameters: stride, padding, dilation, groups, bias, padding_mode

ARGS = {
    'eps': 1e-12,
    'in_channels': 3,
    'out_channels': 5,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'bias': True
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
snlinear Ran
ran; our contract draft was wrong, not the code
james-oldfield/PandA/networks/biggan/model.py
code served (permissive licence) · get_code("de3577618251b913")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Linear. 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 torch
import torch.nn as nn

torch.manual_seed(0)

# The function snlinear takes eps and **kwargs
# The **kwargs are passed to nn.Linear
# nn.Linear requires at minimum: in_features and out_features
# Optional parameters include: bias (default True), device, dtype

ARGS = {
    'eps': 1e-12,
    'in_features': 4,
    'out_features': 3,
    'bias': True
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
truncated_noise_sample Ran
ran, honoured the contract we drafted
james-oldfield/PandA/networks/biggan/utils.py
code served (permissive licence) · get_code("02045c1b6525805b")
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, through the batch API) and returned ndarray, 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 numpy as np
from scipy.stats import truncnorm

ARGS = {
    "batch_size": 2,
    "dim_z": 4,
    "truncation": 1.0,
    "seed": 42,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, 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: none by the harness; any seed is in the setup block
url_to_filename Ran
ran; our contract draft was wrong, not the code
james-oldfield/PandA/networks/biggan/file_utils.py
code served (permissive licence) · get_code("5eff22fa0a651276")
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, through the batch API) and returned str. 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.

from hashlib import sha256

ARGS = {
    "url": "https://example.com/model/checkpoint.bin",
    "etag": "abc123def456"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
build_tf_to_pytorch_map Not yet run
unverified (harvested, no recorded run)
james-oldfield/PandA/networks/biggan/convert_tf_to_pytorch.py
code served (permissive licence) · get_code("ce9a06f7562fa6ed")
How it ran

no invocation recorded.

cached_path Not yet run
unverified (harvested, no recorded run)
james-oldfield/PandA/networks/biggan/file_utils.py
code served (permissive licence) · get_code("1f71e3eff559cc72")
How it ran

no invocation recorded.

extract_batch_norm_stats Not yet run
unverified (harvested, no recorded run)
james-oldfield/PandA/networks/biggan/convert_tf_to_pytorch.py
code served (permissive licence) · get_code("a3d3c599a0b72c6e")
How it ran

no invocation recorded.

filename_to_url Not yet run
unverified (harvested, no recorded run)
james-oldfield/PandA/networks/biggan/file_utils.py
code served (permissive licence) · get_code("c5ba2abfbf6a9dfa")
How it ran

no invocation recorded.

load_tf_weights_in_biggan Not yet run
unverified (harvested, no recorded run)
james-oldfield/PandA/networks/biggan/convert_tf_to_pytorch.py
code served (permissive licence) · get_code("afde54833fdbaac2")
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, 8 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 7 later) and 6 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
url_to_filename 48 other papers
35 dated earlier, 12 later, 1 same year, order not determinable · 8 only as an assembly brick
1610.02424 (2016-10)
Diverse Beam Search: Decoding Diverse Solutions from Neural Sequence Models
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
and 45 more not named here
snlinear 4 other papers
1 dated earlier, 3 later
2004.05675 (2020-04)
A Non-Parametric Test to Detect Data-Copying in Generative Models
2302.02451 (2023-02)
KDEformer: Accelerating Transformers via Kernel Density Estimation
2311.01323 (2023-11)
Towards Evaluating Transfer-based Attacks Systematically, Practically, and Fairly
and 1 more not named here
cached_path 2 other papers
1 dated earlier, 1 later
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
2302.02451 (2023-02)
KDEformer: Accelerating Transformers via Kernel Density Estimation
filename_to_url 2 other papers
1 dated earlier, 1 later
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
2302.02451 (2023-02)
KDEformer: Accelerating Transformers via Kernel Density Estimation
sn_embedding 2 other papers
1 dated earlier, 1 later
2004.05675 (2020-04)
A Non-Parametric Test to Detect Data-Copying in Generative Models
2302.02451 (2023-02)
KDEformer: Accelerating Transformers via Kernel Density Estimation
snconv2d 2 other papers
1 dated earlier, 1 later
2004.05675 (2020-04)
A Non-Parametric Test to Detect Data-Copying in Generative Models
2302.02451 (2023-02)
KDEformer: Accelerating Transformers via Kernel Density Estimation
construct_heatmap 1 other paper
1 later
2409.09867 (2024-09)
Towards Kinetic Manipulation of the Latent Space
truncated_noise_sample 1 other paper
1 dated earlier
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis

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

Repositories linked to this paper

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

Abstract

Recent advances in the understanding of Generative Adversarial Networks (GANs) have led to remarkable progress in visual editing and synthesis tasks, capitalizing on the rich semantics that are embedded in the latent spaces of pre-trained GANs. However, existing methods are often tailored to specific GAN architectures and are limited to either discovering global semantic directions that do not facilitate localized control, or require some form of supervision through manually provided regions or segmentation masks. In this light, we present an architecture-agnostic approach that jointly discovers factors representing spatial parts and their appearances in an entirely unsupervised fashion. These factors are obtained by applying a semi-nonnegative tensor factorization on the feature maps, which in turn enables context-aware local image editing with pixel-level control. In addition, we show that the discovered appearance factors correspond to saliency maps that localize concepts of interest, without using any labels. Experiments on a wide range of GAN architectures and datasets show that, in comparison to the state of the art, our method is far more efficient in terms of training time and, most importantly, provides much more accurate localized control. Our code is available at https://github.com/james-oldfield/PandA.

For agents

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

get_harvested_code_for_paper("2206.00048")
get_code_for_paper("2206.00048")
have("2206.00048")

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

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

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

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

Connect an agent — have() is free.