SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.01774 · 2019

Image Generation From Small Datasets via Batch Statistics Adaptation

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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 4 have no contract verdict; 3 failures of our instrument; 0 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/1904.01774.json · badge: /api/ran/1904.01774.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
nogu-atsu/small-dataset-image-generation canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
MiaoyunZhao/GANTransferLimitedData reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
backward Ran
ran on a synthesized input
nogu-atsu/small-dataset-image-generation/gen_models/ada_generator.py
code served (permissive licence) · get_code("27f00fb3c1db3c49")
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 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 torch.nn as nn

torch.manual_seed(0)

# Create a simple tensor that requires gradients
input_tensor = torch.randn(2, 4, requires_grad=True)

# Create a simple model
model = nn.Linear(4, 3)

# Forward pass to create a loss
output = model(input_tensor)
loss = output.sum()

# The function expects loss to have a .backward() method and .array attribute
# PyTorch tensors have .backward() but not .array by default
# We need to create a wrapper or use a tensor that has .array
# Actually, looking at the function, it calls loss.backward() and returns loss.array
# This suggests loss should be a PyTorch tensor (which has .backward())
# but also have .array attribute. We can monkey-patch or use numpy interop.

# Create a loss as a PyTorch tensor with requires_grad
loss_tensor = torch.tensor(5.0, requires_grad=True)

# Add .array attribute to make it compatible with the function
loss_tensor.array = loss_tensor.detach().numpy()

ARGS = {
    "loss": loss_tensor
}
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 ndarray, 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
load_dataset Ran
ran on a synthesized input
nogu-atsu/small-dataset-image-generation/source/yaml_utils.py
code served (permissive licence) · get_code("db8507e9776f7d80")
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 MockDataset. 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 os
import sys
import tempfile
from types import SimpleNamespace

# Create a temporary directory for the mock dataset module
temp_dir = tempfile.mkdtemp()

# Create a mock dataset module file
mock_dataset_code = '''
class MockDataset:
    def __init__(self, size=10, num_features=4):
        self.size = size
        self.num_features = num_features
        self.data = list(range(size))
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return self.data[idx]
'''

mock_dataset_path = os.path.join(temp_dir, 'mock_dataset.py')
with open(mock_dataset_path, 'w') as f:
    f.write(mock_dataset_code)

# Create config object with required structure
config = SimpleNamespace(
    dataset={
        'dataset_fn': mock_dataset_path,
        'dataset_name': 'MockDataset',
        'args': {
            'size': 10,
            'num_features': 4
        }
    }
)

ARGS = {
    'config': config
}
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 MockDataset — a MockDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockDataset output the recorded ndim 1 and dtype family int 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
load_model Ran
ran on a synthesized input
nogu-atsu/small-dataset-image-generation/source/yaml_utils.py
code served (permissive licence) · get_code("619e0c5cf74a6c9f")
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 SimpleModel. 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 os
import sys
import tempfile

torch.manual_seed(0)

# Create a temporary directory and a minimal model file
temp_dir = tempfile.mkdtemp()

# Create a simple model module
model_code = '''
import torch.nn as nn

class SimpleModel(nn.Module):
    def __init__(self, input_dim=4, output_dim=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

def StandaloneModel(hidden_dim=8):
    return SimpleModel(input_dim=hidden_dim, output_dim=hidden_dim)
'''

model_file = os.path.join(temp_dir, "test_model.py")
with open(model_file, "w") as f:
    f.write(model_code)

# Define ARGS for the load_model function
ARGS = {
    "model_fn": model_file,
    "model_name": "SimpleModel",
    "args": {"input_dim": 4, "output_dim": 3}
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
load_module Ran
ran on a synthesized input
nogu-atsu/small-dataset-image-generation/source/yaml_utils.py
code served (permissive licence) · get_code("f5837ba49e24a57d")
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 type. 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 os
import sys
import tempfile

# Create a temporary module file that contains a simple class
temp_dir = tempfile.mkdtemp()
module_file = os.path.join(temp_dir, "test_module.py")

with open(module_file, "w") as f:
    f.write("""
class TestClass:
    def __init__(self):
        self.value = 42
    
    def method(self):
        return "test"
""")

ARGS = {
    "fn": module_file,
    "name": "TestClass"
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
load_part_model Ran
ran; our contract draft was wrong, not the code
MiaoyunZhao/GANTransferLimitedData/Flower_[h]our.py
code served (permissive licence) · get_code("b3be36dffe58c81c")
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 SimpleModel. 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 SimpleModel(nn.Module):
    def __init__(self, add_embedding=False, add_fc=False):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        if add_embedding:
            self.embedding = nn.Embedding(10, 4)
        if add_fc:
            self.fc = nn.Linear(2, 1)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x
    
    def state_dic(self):
        return self.state_dict()

# Create m_fix with some layers including embedding and fc
m_fix = SimpleModel(add_embedding=True, add_fc=True)

# Create m_ini without embedding and fc (but with matching shared layers)
m_ini = SimpleModel(add_embedding=False, add_fc=False)

ARGS = {
    'm_fix': m_fix,
    'm_ini': m_ini
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
model_equal_all Ran
ran; our contract draft was wrong, not the code
MiaoyunZhao/GANTransferLimitedData/Flower_[h]our.py
code served (permissive licence) · get_code("66246b3d037551d8")
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 SimpleModel. 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 SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.bias = nn.Parameter(torch.randn(2))
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

state_dict_update = {
    'linear.weight': torch.randn(3, 4),
    'linear.bias': torch.randn(3),
    'bias': torch.randn(2)
}

ARGS = {
    'model': model,
    'dict': state_dict_update
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
model_equal_part Ran
ran; our contract draft was wrong, not the code
MiaoyunZhao/GANTransferLimitedData/Flower_[h]our.py
code served (permissive licence) · get_code("9e7bbefa29f18123")
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 SimpleModel. 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 a simple model with state_dict containing various parameter types
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(4, 3)
        self.embedding = nn.Embedding(10, 4)
        self.fc2 = nn.Linear(3, 2)
        self.conv = nn.Conv1d(4, 5, 3)
    
    def forward(self, x):
        return x

model = SimpleModel()

# Create a dict_all with various keys, including some that match model state_dict
# and some that don't, including embedding and fc keys
dict_all = {
    'fc1.weight': torch.randn(3, 4),
    'fc1.bias': torch.randn(3),
    'embedding.weight': torch.randn(10, 4),  # Should be filtered out
    'fc2.weight': torch.randn(2, 3),  # Should be filtered out (contains 'fc')
    'fc2.bias': torch.randn(2),  # Should be filtered out (contains 'fc')
    'conv.weight': torch.randn(5, 4, 3),
    'conv.bias': torch.randn(5),
    'nonexistent_key': torch.randn(2, 2),  # Not in model_dict, should be ignored
}

ARGS = {
    'model': model,
    'dict_all': dict_all,
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 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
load_part_model 2 other papers
2 later
2210.16559 (2022-10)
Few-shot Image Generation via Adaptation-Aware Kernel Modulation
2304.07574 (2023-04)
Exploring Incompatible Knowledge Transfer in Few-shot Image Generation

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

Thanks to the recent development of deep generative models, it is becoming possible to generate high-quality images with both fidelity and diversity. However, the training of such generative models requires a large dataset. To reduce the amount of data required, we propose a new method for transferring prior knowledge of the pre-trained generator, which is trained with a large dataset, to a small dataset in a different domain. Using such prior knowledge, the model can generate images leveraging some common sense that cannot be acquired from a small dataset. In this work, we propose a novel method focusing on the parameters for batch statistics, scale and shift, of the hidden layers in the generator. By training only these parameters in a supervised manner, we achieved stable training of the generator, and our method can generate higher quality images compared to previous methods without collapsing, even when the dataset is small (~100). Our results show that the diversity of the filters acquired in the pre-trained generator is important for the performance on the target domain. Our method makes it possible to add a new class or domain to a pre-trained generator without disturbing the performance on the original domain.

For agents

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

get_harvested_code_for_paper("1904.01774")
get_code_for_paper("1904.01774")
have("1904.01774")

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

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

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

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

Connect an agent — have() is free.