SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1802.05957 · 2018

Spectral Normalization for Generative Adversarial Networks

Takeru Miyato, Masanori Koyama, Yuichi Yoshida, Toshiki Kataoka

arXiv · PDF · Open in the Atlas

Code that ran

25 of 31 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (9 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 20 have no contract verdict; 4 failures of our instrument; 6 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/1802.05957.json · badge: /api/ran/1802.05957.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
Xiaoming-Yu/SingleGAN community (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
karoly-hars/GAN_image_colorizing community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
ksagit/sn_gan_pytorch community
Papers with Code archive
2 ran · 0 no recorded run
zzmtsvv/adversarial community
not in the paper's declared repositories
2 ran · 0 no recorded run
koshian2/SNGAN community
Papers with Code archive
2 ran · 0 no recorded run
bayraktarbaris/SNGAN community
Papers with Code archive
1 ran · 1 no recorded run
crcrpar/pytorch.sngan_projection named in the paper
Papers with Code archive
1 ran · 0 no recorded run
IShengFang/SpectralNormalizationKeras community
Papers with Code archive
1 ran · 0 no recorded run
GrayXu/SpectralNormalization-TF-Keras community
Papers with Code archive
1 ran · 0 no recorded run
adbobes/VideoSuperResolution community
Papers with Code archive
1 ran · 0 no recorded run
karolrogozinski/cern_alice_fast_sim_corrvae community
Papers with Code archive
1 ran · 0 no recorded run
meg965/pytorch-rl community
Papers with Code archive
1 ran · 0 no recorded run
hanyoseob/pytorch-sngan community
Papers with Code archive
1 ran · 0 no recorded run
apnkv/nla_spectral_norm community
Papers with Code archive
1 ran · 0 no recorded run
christiancosgrove/pytorch-spectral-normalization-gan community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
Mohanned-Elkholy/ResNet-GAN community
Papers with Code archive
0 ran · 1 no recorded run
WangZesen/Spectral-Normalization-GAN community
Papers with Code archive
0 ran · 1 no recorded run
hinofafa/Self-Attention-HearthStone-GAN community
Papers with Code archive
0 ran · 1 no recorded run
taki0112/Spectral_Normalization-Tensorflow community
not in the paper's declared repositories
0 ran · 1 no recorded run
FunctionStatusWhere it lives
Block Ran
ran on a synthesized input · constructed an object; no result was computed
crcrpar/pytorch.sngan_projection/models/discriminators/resblocks.py
code served (permissive licence) · get_code("140b5bac7a8508a9")
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 an instance of its own class, Block: the run constructed the object and did not call it, so no result was computed. 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
import torch.nn.functional as F
import math

torch.manual_seed(0)

ARGS = {
    'in_ch': 3,
    'out_ch': 16,
    'h_ch': None,
    'ksize': 3,
    'pad': 1,
    'activation': F.relu,
    'downsample': 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 Block — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Block 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
DenseSN Ran
ran on a synthesized input · constructed an object; no result was computed
IShengFang/SpectralNormalizationKeras/SpectralNormalizationKeras.py
pointer only (licence: NOASSERTION) · get_code("1618dd723285892b")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, IShengFang/SpectralNormalizationKeras (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.

DenseSN Ran
ran on a synthesized input · constructed an object; no result was computed
GrayXu/SpectralNormalization-TF-Keras/SNorm_tf_keras.py
code served (permissive licence) · get_code("78f554911984ea8d")
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 an instance of its own class, DenseSN: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
from tensorflow.keras.layers import InputSpec
from tensorflow.keras import initializers

# Create a minimal DenseSN instance to understand its parameters
# DenseSN inherits from Dense, so we need to provide Dense parameters

ARGS = {
    'units': 8,
    'activation': None,
    'use_bias': True,
    'kernel_initializer': initializers.GlorotUniform(),
    'bias_initializer': initializers.Zeros(),
    'kernel_regularizer': None,
    'bias_regularizer': None,
    'activity_regularizer': None,
    'kernel_constraint': None,
    'bias_constraint': None,
    'dtype': tf.float32,
    'trainable': True,
    'name': 'dense_sn'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DenseSN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DenseSN 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
KL_loss Ran
ran on a synthesized input
Xiaoming-Yu/SingleGAN/util/loss.py
code served (permissive licence) · get_code("64ebe64e3ec531c1")
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 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

torch.manual_seed(0)

# Create small tensors for mu and logvar
# mu: mean of latent distribution, shape (batch_size, latent_dim)
# logvar: log variance of latent distribution, shape (batch_size, latent_dim)
mu = torch.randn(2, 4)
logvar = torch.randn(2, 4)

ARGS = {
    "mu": mu,
    "logvar": logvar,
}
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 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
ResidualBlock Ran
ran on a synthesized input
adbobes/VideoSuperResolution/models/frvsr.py
pointer only (licence: NONE) · get_code("f202366742ae57fc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, adbobes/VideoSuperResolution when it was checked. 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.

SNLinear Ran
ran on a synthesized input
ksagit/sn_gan_pytorch/spectral_layers.py
pointer only (licence: NONE) · get_code("e5baa0b3b62b8c9b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ksagit/sn_gan_pytorch when it was checked. 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.

SNLinear Ran
ran on a synthesized input · constructed an object; no result was computed
zzmtsvv/adversarial/sn_gan/sn_modules.py
pointer only (licence: NONE) · get_code("2ed2088d35626661")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zzmtsvv/adversarial when it was checked. 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.

SpectralNorm Ran
ran on a synthesized input · constructed an object; no result was computed
karolrogozinski/cern_alice_fast_sim_corrvae/utils/spectral_norm_fc.py
pointer only (licence: NONE) · get_code("eee46d1790d3fc3d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, karolrogozinski/cern_alice_fast_sim_corrvae when it was checked. 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.

SpectralNorm Ran
ran on a synthesized input · constructed an object; no result was computed
meg965/pytorch-rl/Layers/Spectral_norm.py
pointer only (licence: NONE) · get_code("c11fdae8c1eaa067")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, meg965/pytorch-rl when it was checked. 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.

SpectralNorm Ran
ran on a synthesized input · constructed an object; no result was computed
koshian2/SNGAN/models/core_layers.py
code served (permissive licence) · get_code("a587e964e3b73e7f")
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 an instance of its own class, SpectralNorm: the run constructed the object and did not call it, so no result was computed. 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 import nn

torch.manual_seed(0)

# Create a simple module with a weight parameter
# The SpectralNorm wrapper expects the module to have a 'weight' attribute
base_module = nn.Linear(3, 4)

# Create the SpectralNorm wrapper
# Parameters: module, name, power_iterations
ARGS = {
    'module': base_module,
    'name': 'weight',
    'power_iterations': 1
}
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 SpectralNorm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SpectralNorm 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
SpectralNorm Ran
ran on a synthesized input · constructed an object; no result was computed
hanyoseob/pytorch-sngan/layer.py
pointer only (licence: NONE) · get_code("95f6381171e5b22f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, hanyoseob/pytorch-sngan when it was checked. 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.

SpectralNorm Ran
ran on a synthesized input · constructed an object; no result was computed
apnkv/nla_spectral_norm/spec_norm_diff.py
pointer only (licence: NONE) · get_code("eea0b4fc0256e64c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, apnkv/nla_spectral_norm when it was checked. 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.

get_nl_layer Ran
ran on a synthesized input
Xiaoming-Yu/SingleGAN/models/model.py
code served (permissive licence) · get_code("146991926013af84")
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 partial. 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
import functools

torch.manual_seed(0)

ARGS = {
    'layer_type': 'relu'
}
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 partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial 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
l2_normalization Ran
ran; our contract draft was wrong, not the code
bayraktarbaris/SNGAN/spectral_normalization.py
pointer only (licence: NONE) · get_code("7a608922984c40b9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bayraktarbaris/SNGAN when it was checked. 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.

l2_normalize Ran
ran; our contract draft was wrong, not the code
zzmtsvv/adversarial/sn_gan/sn_modules.py
pointer only (licence: NONE) · get_code("bf5a05c7adc49b0b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, zzmtsvv/adversarial when it was checked. 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.

l2normalize Ran
ran; our contract draft was wrong, not the code
christiancosgrove/pytorch-spectral-normalization-gan/spectral_normalization.py
pointer only (licence: MIT); the stored copy get_code serves, from xxxliu95/RA_FA_Cardiac, is pointer only (licence: NONE) · get_code("bedff51745d2cf84")
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 xxxliu95/RA_FA_Cardiac, and GitHub detected no licence in that repository when it was checked. 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.

l2normalize Ran
ran, violated the contract we drafted
koshian2/SNGAN/models/core_layers.py
code served (permissive licence) · get_code("9b11458d7d1ec61c")
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 1, dtype family float, shape (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 l2normalize takes a vector v and normalizes it by dividing by its norm + eps
# v needs to be a torch tensor with a .norm() method
# eps is a small float for numerical stability

v = torch.randn(4)

ARGS = {
    "v": v,
    "eps": 0.0001
}
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 1, dtype family float, shape (4,) — shape (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
max_singular_value Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ksagit/sn_gan_pytorch/spectral_layers.py
pointer only (licence: NONE) · get_code("6ca4fd5871d2fad1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ksagit/sn_gan_pytorch when it was checked. 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.

pickle_load Ran
ran on a synthesized input
Xiaoming-Yu/SingleGAN/util/util.py
code served (permissive licence) · get_code("c4b9e0cb79abdf65")
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 dict. 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 pickle
import tempfile
import os

# Create a temporary pickle file with some test data
test_data = {
    'key1': 'value1',
    'key2': [1, 2, 3],
    'key3': {'nested': 'dict'}
}

# Create a temporary file and write pickle data to it
temp_dir = tempfile.gettempdir()
temp_file = os.path.join(temp_dir, 'test_pickle_data.pkl')

with open(temp_file, 'wb') as f:
    pickle.dump(test_data, f)

# Define arguments for pickle_load function
ARGS = {
    'file_name': temp_file
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
postprocess Ran
ran on a synthesized input
karoly-hars/GAN_image_colorizing/datasets.py
code served (permissive licence) · get_code("128a565cc437a6cb")
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 3, dtype family int, shape (4, 5, 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 cv2
import numpy as np
import torch

torch.manual_seed(0)

# The function expects img_lab to be a numpy array with shape (C, H, W)
# where C=3 (LAB channels), H and W are height/width dimensions
# After transpose((1, 2, 0)), it becomes (H, W, C)

# Create a small LAB image array with shape (3, 4, 5) for (C, H, W)
# Values in range that makes sense for LAB:
# L channel (normalized): roughly [-1, 1] range
# a, b channels (normalized): roughly [-1, 1] range
img_lab = np.random.randn(3, 4, 5).astype(np.float32) * 0.5

ARGS = {
    "img_lab": img_lab
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (4, 5, 3) — shape (4, 5, 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: none by the harness; any seed is in the setup block
preprocess Ran
ran on a synthesized input
karoly-hars/GAN_image_colorizing/datasets.py
code served (permissive licence) · get_code("01d26fcf1d7994f7")
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 3, dtype family float, shape (3, 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 cv2
import numpy as np

# Create a small BGR image (height=4, width=3, channels=3)
# Using uint8 values in [0, 255] range
img_bgr = np.random.randint(0, 256, size=(4, 3, 3), dtype=np.uint8)

ARGS = {
    "img_bgr": img_bgr
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (3, 4, 3) — shape (3, 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: none by the harness; any seed is in the setup block
tensor2im Ran
ran on a synthesized input
Xiaoming-Yu/SingleGAN/util/util.py
code served (permissive licence) · get_code("6c7988ea60c79ae4")
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 3, dtype family int, shape (4, 5, 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
import numpy as np

torch.manual_seed(0)

# Create a valid image tensor
# The function expects shape (C, H, W) for 3D or (B, C, H, W) for 4D
# Values should be in range [-1, 1] based on the (+ 1) / 2.0 operation
image_tensor_3d = torch.randn(3, 4, 5)  # (C=3, H=4, W=5)

ARGS = {
    "image_tensor": image_tensor_3d,
    "imtype": np.uint8,
    "cvt_rgb": True,
}
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 ndarray, ndim 3, dtype family int, shape (4, 5, 3) — shape (4, 5, 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: none by the harness; any seed is in the setup block
tensor2vec Ran
ran on a synthesized input
Xiaoming-Yu/SingleGAN/util/util.py
code served (permissive licence) · get_code("86091e3080eadd73")
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 torch
import numpy as np

torch.manual_seed(0)

# Test case 1: 4D tensor (batch, channels, height, width)
vector_tensor_4d = torch.randn(2, 4, 1, 1)

# Test case 2: 2D tensor (batch, features)
vector_tensor_2d = torch.randn(2, 4)

ARGS = {
    "vector_tensor": vector_tensor_4d
}
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 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
unpickle_batch Ran
ran on a synthesized input
karoly-hars/GAN_image_colorizing/datasets.py
code served (permissive licence) · get_code("a01c9b17a6119a4a")
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 dict. 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 pickle
import tempfile
import os

# Create a temporary directory and file for pickling
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, 'test_batch.pkl')

# Create a sample dictionary with bytes keys (as indicated by encoding='bytes')
sample_dict = {
    b'data': [1, 2, 3, 4],
    b'labels': [0, 1, 0, 1],
    b'filenames': [b'file1', b'file2', b'file3', b'file4']
}

# Pickle the sample dictionary to the temporary file
with open(temp_file, 'wb') as f:
    pickle.dump(sample_dict, f)

ARGS = {
    'file': temp_file
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
weights_init Ran
ran on a synthesized input
Xiaoming-Yu/SingleGAN/models/model.py
code served (permissive licence) · get_code("07d08fa9cc777740")
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 function. 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 torch.nn import init
import math

# Create a simple model with Conv and Linear layers
class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.conv1 = nn.Conv2d(3, 16, kernel_size=3)
        self.linear1 = nn.Linear(16, 10)
    
    def forward(self, x):
        return x

torch.manual_seed(0)

# Define the weights_init function
def weights_init(init_type='xavier'):
    def init_fun(m):
        classname = m.__class__.__name__
        if (classname.find('Conv') == 0 or classname.find('Linear') == 0) and hasattr(m, 'weight'):
            if init_type == 'normal':
                init.normal(m.weight.data, 0.0, 0.02)
            elif init_type == 'xavier':
                init.xavier_normal(m.weight.data, gain=math.sqrt(2))
            elif init_type == 'kaiming':
                init.kaiming_normal(m.weight.data, a=0, mode='fan_in')
            elif init_type == 'orthogonal':
                init.orthogonal(m.weight.data, gain=math.sqrt(2))
            elif init_type == 'default':
                pass
            else:
                assert 0, 'Unsupported initialization: {}'.format(init_type)
            if hasattr(m, 'bias') and m.bias is not None:
                init.constant(m.bias.data, 0.0)
    return init_fun

# Create model and apply initialization
model = SimpleModel()

ARGS = {
    'init_type': 'xavier'
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
ResBlockDiscriminator Not yet run
unverified (harvested, no recorded run)
Mohanned-Elkholy/ResNet-GAN/src/discriminator/utils.py
code served (permissive licence) · get_code("ad0eca31b5e574c4")
How it ran

no invocation recorded.

SN Not yet run
unverified (harvested, no recorded run)
WangZesen/Spectral-Normalization-GAN/SNLayer.py
pointer only (licence: NONE) · get_code("448cdd7f0cee0721")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, WangZesen/Spectral-Normalization-GAN when it was checked. 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. No invocation recorded.

SpectralNorm Not yet run
unverified (harvested, no recorded run)
hinofafa/Self-Attention-HearthStone-GAN/spectral.py
pointer only (licence: NONE) · get_code("5c6f3d4b49c16aa5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, hinofafa/Self-Attention-HearthStone-GAN when it was checked. 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. No invocation recorded.

SpectralNorm Not yet run
unverified (harvested, no recorded run)
bayraktarbaris/SNGAN/spectral_normalization.py
pointer only (licence: NONE) · get_code("cb5d0b5f94066d27")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bayraktarbaris/SNGAN when it was checked. 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. No invocation recorded.

get_norm_layer Not yet run
unverified (harvested, no recorded run)
Xiaoming-Yu/SingleGAN/models/model.py
code served (permissive licence) · get_code("463156b57378ec6e")
How it ran

no invocation recorded.

spectral_norm Not yet run
unverified (harvested, no recorded run)
taki0112/Spectral_Normalization-Tensorflow/spectral_norm.py
code served (permissive licence) · get_code("4d8feb46b282de73")
How it ran

no invocation recorded.

Also present in other papers' code

Of 31 samples lifted from this paper's linked repositories, 31 carry a function identity and 0 do not. Of the 30 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 3 later) and 27 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
l2normalize
brick of this paper's assembly: helper
27 other papers
1 dated earlier, 26 later · 2 only as an assembly brick
1703.09452 (2017-03)
SEGAN: Speech Enhancement Generative Adversarial Network
1806.03589 (2018-06)
Free-Form Image Inpainting with Gated Convolution
1810.08771 (2018-10)
Image Inpainting via Generative Multi-column Convolutional Neural Networks
and 24 more not named here
l2normalize
brick of this paper's assembly: helper
2 other papers
2 later
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
2201.12179 (2022-01)
Plug & Play Attacks: Towards Robust and Flexible Model Inversion Attacks
SpectralNorm
brick of this paper's assembly: entry
1 other paper
1 later
2311.02202 (2023-11)
Neural Collage Transfer: Artistic Reconstruction via Material Manipulation

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

More are linked than shown here.

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

Abstract

One of the challenges in the study of generative adversarial networks is the instability of its training. In this paper, we propose a novel weight normalization technique called spectral normalization to stabilize the training of the discriminator. Our new normalization technique is computationally light and easy to incorporate into existing implementations. We tested the efficacy of spectral normalization on CIFAR10, STL-10, and ILSVRC2012 dataset, and we experimentally confirmed that spectrally normalized GANs (SN-GANs) is capable of generating images of better or equal quality relative to the previous training stabilization techniques. The code with Chainer (Tokui et al., 2015), generated images and pretrained models are available at https://github.com/pfnet-research/sngan_ projection.

For agents

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

get_harvested_code_for_paper("1802.05957")
get_code_for_paper("1802.05957")
have("1802.05957")

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

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

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

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

Connect an agent — have() is free.