SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.15646 · 2020

Rewriting a Deep Generative Model

arXiv · PDF · Open in the Atlas

Code that ran

18 of 23 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; 4 honoured the contract we drafted, 1 violated it and 7 have no contract verdict; 6 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2007.15646.json · badge: /api/ran/2007.15646.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
davidbau/rewriting canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
PeterWang512/GANSketching community (classifier label)
classifier basis not recorded on the link
11 ran · 5 no recorded run
revsic/Rewriting-A-Deep-Generative-Models community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
apply_ablation_replacement Ran
ran, honoured the contract we drafted
revsic/Rewriting-A-Deep-Generative-Models/utils/nethook.py
pointer only (licence: MIT); the stored copy get_code serves, from davidbau/dissect, is pointer only (licence: NOASSERTION) · get_code("e6e2771a0de59277")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from davidbau/dissect, 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.

centered_location Ran
ran, honoured the contract we drafted
davidbau/rewriting/rewrite/ganrewrite.py
code served (permissive licence) · get_code("7ad7dc9cfae49b02")
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 tuple, ndim 1, 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 warnings

torch.manual_seed(0)

# Create a small 2D tensor with some positive values
# The function expects data where we can find positive values and compute bounding boxes
data = torch.tensor([
    [0, 1, 2, 0],
    [0, 3, 0, 4],
    [5, 0, 0, 0]
], dtype=torch.float32)

ARGS = {
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple 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
create_dataloader Ran
ran on a synthesized input
PeterWang512/GANSketching/training/dataset.py
code served (permissive licence) · get_code("53eba98d072664b8")
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 tuple, ndim 1, 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 tempfile
import pathlib
from PIL import Image
import torch
from torchvision import transforms

torch.manual_seed(0)

# Create a temporary directory with test images
temp_dir = tempfile.mkdtemp()
temp_path = pathlib.Path(temp_dir)

# Create a few small test images
for i in range(3):
    img = Image.new('RGB', (8, 8), color=(73, 109, 137))
    img.save(temp_path / f'test_image_{i}.png')

ARGS = {
    'data_dir': temp_dir,
    'size': (4, 4),
    'batch': 2,
    'img_channel': 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
data_sampler Ran
ran on a synthesized input
PeterWang512/GANSketching/training/dataset.py
code served (permissive licence) · get_code("d2adc53663eaf8a1")
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 RandomSampler. 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
from torch.utils import data

torch.manual_seed(0)

# Create a simple dataset
class SimpleDataset(data.Dataset):
    def __init__(self, size=4):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return torch.randn(3), torch.randint(0, 2, (1,))

dataset = SimpleDataset(size=4)

ARGS = {
    "dataset": dataset,
    "shuffle": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RandomSampler — a RandomSampler output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RandomSampler 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
gen_principal_components Ran
ran on a synthesized input
PeterWang512/GANSketching/ganspace.py
code served (permissive licence) · get_code("3ff05cdbf246edc5")
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 tuple. 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 numpy as np
import tempfile
import os

torch.manual_seed(0)

# Create a temporary .npz file with the required arrays
temp_dir = tempfile.gettempdir()
dump_file = os.path.join(temp_dir, "test_ganspace.npz")

# Create small arrays matching what the function expects
lat_comp = np.random.randn(4, 3).astype(np.float32)  # principal components
lat_mean = np.random.randn(4).astype(np.float32)     # mean latent vector
lat_stdev = np.array([1.0, 1.0, 1.0, 1.0], dtype=np.float32)  # standard deviations

# Save to npz file
np.savez(dump_file, lat_comp=lat_comp, lat_mean=lat_mean, lat_stdev=lat_stdev)

ARGS = {
    'dump_name': dump_file,
    'device': 'cpu'
}
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 tuple — a tuple output has no array shape of its own; none is 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
get_param_by_name Ran
ran on a synthesized input
PeterWang512/GANSketching/training/gan_model.py
code served (permissive licence) · get_code("00215dbe8680445b")
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 tuple. 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)

class SimpleNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        self.conv1 = nn.Conv1d(2, 5, 3)
        self.batch_norm = nn.BatchNorm1d(5)
    
    def forward(self, x):
        return x

net = SimpleNet()
tgt_param = "linear"

ARGS = {
    "net": net,
    "tgt_param": tgt_param,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
lerp Ran
ran, honoured the contract we drafted
PeterWang512/GANSketching/eval/ppl.py
pointer only (licence: MIT); the stored copy get_code serves, from thenhz/progressive_growing_of_gan, is pointer only (licence: NOASSERTION) · get_code("0c45399f3741921e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from thenhz/progressive_growing_of_gan, 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.

make_kernel Ran
ran, violated the contract we drafted
davidbau/rewriting/utils/stylegan2/models.py
code served (permissive licence) · get_code("9ea2d5da223e8492")
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 Tensor, ndim 2, dtype family float, shape (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
import math

torch.manual_seed(0)

# The function make_kernel takes a parameter 'k' which can be:
# - a 1D array/tensor (will be converted to 2D via outer product)
# - a 2D array/tensor (used as-is)
# It converts to float32 tensor, normalizes by sum, and returns

# Test case 1: 1D input (will create outer product)
k_1d = [0.5, 1.0, 1.5, 2.0]

ARGS = {
    "k": k_1d
}
Setup block drafted by
a language model, Claude Haiku 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 Tensor, ndim 2, dtype family float, shape (4, 4) — shape (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: none by the harness; any seed is in the setup block
make_matching_tensor Ran
ran; our contract draft was wrong, not the code
revsic/Rewriting-A-Deep-Generative-Models/utils/nethook.py
pointer only (licence: MIT); the stored copy get_code serves, from davidbau/dissect, is pointer only (licence: NOASSERTION) · get_code("0a92af765d5132e3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from davidbau/dissect, 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.

mixing_noise Ran
ran on a synthesized input
PeterWang512/GANSketching/training/gan_model.py
code served (permissive licence) · get_code("feeb5b7716528a75")
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 tuple, ndim 3, 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 random
import torch

torch.manual_seed(0)

ARGS = {
    "batch": 2,
    "latent_dim": 4,
    "prob": 0.5,
    "device": "cpu"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple 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
normalize Ran
ran on a synthesized input
PeterWang512/GANSketching/eval/ppl.py
code served (permissive licence) · get_code("bfd30ba25798287e")
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 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

torch.manual_seed(0)

# The function normalize takes a tensor x and normalizes it along the last dimension
# by dividing by the L2 norm computed along that dimension
# x should be a tensor with shape (batch, ..., features)

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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: none by the harness; any seed is in the setup block
paste_clip_at_center Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
davidbau/rewriting/rewrite/ganrewrite.py
code served (permissive licence) · get_code("36f9b37b3b5c5296")
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 tuple. 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)

# Create source tensor: batch=2, channels=4, height=8, width=6
source = torch.randn(2, 4, 8, 6)

# Create clip tensor: batch=2, channels=4, height=3, width=5
clip = torch.randn(2, 4, 3, 5)

# Center point for pasting
center = (4, 3)

# Create area mask: height=3, width=5 (same spatial dims as clip)
area = torch.rand(3, 5)

ARGS = {
    "source": source,
    "clip": clip,
    "center": center,
    "area": area
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
positive_bounding_box Ran
ran, honoured the contract we drafted
davidbau/rewriting/rewrite/ganrewrite.py
code served (permissive licence) · get_code("c3b0830b8cc3c87b")
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 tuple, ndim 1, 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 warnings

torch.manual_seed(0)

# The function expects a tensor-like object with:
# - comparison operator (>)
# - .sum() method
# - ability to call .nonzero() on summed results
# - .min() and .max() methods on nonzero results
# - .item() method on min/max results

# Create a small 2D tensor with some positive and negative values
data = torch.tensor([
    [1.0, -0.5, 2.0, 0.0],
    [-1.0, 3.0, -0.2, 0.5]
], dtype=torch.float32)

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple 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
rand_brightness Ran
ran; our contract draft was wrong, not the code
PeterWang512/GANSketching/training/networks/diffaug.py
pointer only (licence: MIT); the stored copy get_code serves, from postech-cvlab/pytorch-studiogan, is pointer only (licence: NOASSERTION) · get_code("011230b2b9b8fb6f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from postech-cvlab/pytorch-studiogan, 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.

rand_contrast Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
PeterWang512/GANSketching/training/networks/diffaug.py
code served (permissive licence) · get_code("cf3f99cfbe8f451a")
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 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

torch.manual_seed(0)

# The function rand_contrast takes a tensor x and applies random contrast adjustment
# It expects x to be a 4D tensor (batch, channels, height, width)
# The function:
# 1. Computes mean across spatial dimensions (dims 1,2,3)
# 2. Normalizes by subtracting mean
# 3. Scales by random factor (0.5 to 1.5)
# 4. Adds mean back

# Create a small 4D tensor: (batch=2, channels=3, height=4, width=5)
x = torch.randn(2, 3, 4, 5, dtype=torch.float32)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 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 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: none by the harness; any seed is in the setup block
rand_saturation Ran
ran; our contract draft was wrong, not the code
PeterWang512/GANSketching/training/networks/diffaug.py
pointer only (licence: MIT); the stored copy get_code serves, from postech-cvlab/pytorch-studiogan, is pointer only (licence: NOASSERTION) · get_code("5b0d8787e670fc63")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from postech-cvlab/pytorch-studiogan, 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.

slerp Ran
ran on a synthesized input
PeterWang512/GANSketching/eval/ppl.py
code served (permissive licence) · get_code("904ef2c2720850a0")
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 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

torch.manual_seed(0)

# Create small tensors for a and b
# The function expects tensors where the last dimension is the feature dimension
# We'll use batch_size=2, feature_dim=4
a = torch.randn(2, 4)
b = torch.randn(2, 4)
t = torch.tensor([[0.3], [0.7]])

ARGS = {
    "a": a,
    "b": b,
    "t": t,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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: none by the harness; any seed is in the setup block
subsequence Ran
ran; our contract draft was wrong, not the code
revsic/Rewriting-A-Deep-Generative-Models/utils/nethook.py
code served (permissive licence) · get_code("4746337d187a61f7")
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 Sequential. 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
from collections import OrderedDict

torch.manual_seed(0)

# Build a nested Sequential model with various layers
inner_sequential = nn.Sequential(OrderedDict([
    ('inner_0', nn.Linear(4, 3)),
    ('inner_1', nn.ReLU()),
    ('inner_2', nn.Linear(3, 2)),
]))

sequential = nn.Sequential(OrderedDict([
    ('layer_0', nn.Linear(4, 4)),
    ('layer_1', nn.ReLU()),
    ('layer_2', nn.Linear(4, 3)),
    ('layer_3', inner_sequential),
    ('layer_4', nn.Linear(3, 2)),
    ('layer_5', nn.ReLU()),
]))

ARGS = {
    'sequential': sequential,
    'first_layer': 'layer_1',
    'last_layer': 'layer_4',
    'after_layer': None,
    'upto_layer': None,
    'single_layer': None,
    'share_weights': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is 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
apply_shift Not yet run
unverified (harvested, no recorded run)
PeterWang512/GANSketching/ganspace.py
code served (permissive licence) · get_code("e31916f9b07f1f86")
How it ran

no invocation recorded.

define_D Not yet run
unverified (harvested, no recorded run)
PeterWang512/GANSketching/training/networks/misc.py
code served (permissive licence) · get_code("d976b9fd5ba3e472")
How it ran

no invocation recorded.

define_G Not yet run
unverified (harvested, no recorded run)
PeterWang512/GANSketching/training/networks/misc.py
code served (permissive licence) · get_code("82adc25dc5feb7de")
How it ran

no invocation recorded.

get_stats Not yet run
unverified (harvested, no recorded run)
PeterWang512/GANSketching/run_metrics.py
code served (permissive licence) · get_code("0c04f59973771055")
How it ran

no invocation recorded.

get_vgg_features Not yet run
unverified (harvested, no recorded run)
PeterWang512/GANSketching/run_metrics.py
code served (permissive licence) · get_code("f7014d8c994c5c5b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 23 distinct functions with an identity, 10 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 1 the same month, 10 later) and 13 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
subsequence 49 other papers
49 later
2009.05041 (2020-09)
Understanding the Role of Individual Units in a Deep Neural Network
2110.04292 (2021-10)
Toward a Visual Concept Vocabulary for GAN Latent Space
2210.07229 (2022-10)
Mass-Editing Memory in a Transformer
and 46 more not named here
make_kernel 40 other papers
2 dated earlier, 1 the same month, 37 later · 10 only as an assembly brick
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
1912.04958 (2019-12)
Analyzing and Improving the Image Quality of StyleGAN
2007.06600 (2020-07)
Closed-Form Factorization of Latent Semantics in GANs
and 37 more not named here
rand_brightness 17 other papers
2 dated earlier, 15 later
1912.04958 (2019-12)
Analyzing and Improving the Image Quality of StyleGAN
2006.10738 (2020-06)
Differentiable Augmentation for Data-Efficient GAN Training
2104.03310 (2021-04)
Regularizing Generative Adversarial Networks under Limited Data
and 14 more not named here
rand_saturation 16 other papers
2 dated earlier, 14 later
1912.04958 (2019-12)
Analyzing and Improving the Image Quality of StyleGAN
2006.10738 (2020-06)
Differentiable Augmentation for Data-Efficient GAN Training
2104.03310 (2021-04)
Regularizing Generative Adversarial Networks under Limited Data
and 13 more not named here
lerp 7 other papers
4 dated earlier, 3 later
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
1802.08797 (2018-02)
Residual Dense Network for Image Super-Resolution
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
and 4 more not named here
apply_ablation_replacement 4 other papers
1 dated earlier, 3 later
2003.13659 (2020-03)
Exploiting Deep Generative Prior for Versatile Image Restoration and Manipulation
2009.05041 (2020-09)
Understanding the Role of Individual Units in a Deep Neural Network
2110.04292 (2021-10)
Toward a Visual Concept Vocabulary for GAN Latent Space
and 1 more not named here
make_matching_tensor 4 other papers
1 dated earlier, 3 later
2003.13659 (2020-03)
Exploiting Deep Generative Prior for Versatile Image Restoration and Manipulation
2009.05041 (2020-09)
Understanding the Role of Individual Units in a Deep Neural Network
2110.04292 (2021-10)
Toward a Visual Concept Vocabulary for GAN Latent Space
and 1 more not named here
rand_contrast 2 other papers
1 dated earlier, 1 later
2006.10738 (2020-06)
Differentiable Augmentation for Data-Efficient GAN Training
2111.01007 (2021-11)
Projected GANs Converge Faster
normalize 1 other paper
1 later
2203.17266 (2022-03)
TransEditor: Transformer-Based Dual-Space GAN for Highly Controllable Facial Editing
slerp 1 other paper
1 later
2203.17266 (2022-03)
TransEditor: Transformer-Based Dual-Space GAN for Highly Controllable Facial Editing

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

Repositories linked to this paper

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

Abstract

A deep generative model such as a GAN learns to model a rich set of semantic and physical rules about the target distribution, but up to now, it has been obscure how such rules are encoded in the network, or how a rule could be changed. In this paper, we introduce a new problem setting: manipulation of specific rules encoded by a deep generative model. To address the problem, we propose a formulation in which the desired rule is changed by manipulating a layer of a deep network as a linear associative memory. We derive an algorithm for modifying one entry of the associative memory, and we demonstrate that several interesting structural rules can be located and modified within the layers of state-of-the-art generative models. We present a user interface to enable users to interactively change the rules of a generative model to achieve desired effects, and we show several proof-of-concept applications. Finally, results on multiple datasets demonstrate the advantage of our method against standard fine-tuning methods and edit transfer algorithms.

For agents

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

get_harvested_code_for_paper("2007.15646")
get_code_for_paper("2007.15646")
have("2007.15646")

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

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

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

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

Connect an agent — have() is free.