SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1901.08753 · 2019

On Output Activation Functions for Adversarial Losses: A Theoretical Analysis via Variational Divergence Minimization and An Empirical Study on MNIST Classification

arXiv · PDF · Open in the Atlas

Code that ran

8 of 16 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 8 have no contract verdict; 0 failures of our instrument; 8 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/1901.08753.json · badge: /api/ran/1901.08753.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
salu133445/dan canonical (classifier label)
classifier basis: census
8 ran · 8 no recorded run
FunctionStatusWhere it lives
get_l2_norm Ran
ran on a synthesized input
salu133445/dan/src/dan/model.py
code served (permissive licence) · get_code("5da276d0f1cfbea3")
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 EagerTensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import tensorflow as tf

# Create a small tensor for testing
# The function computes L2 norm over all dimensions except the first (batch) dimension
tensor = tf.constant([
    [[1.0, 2.0, 3.0, 4.0],
     [5.0, 6.0, 7.0, 8.0],
     [9.0, 10.0, 11.0, 12.0]],
    [[13.0, 14.0, 15.0, 16.0],
     [17.0, 18.0, 19.0, 20.0],
     [21.0, 22.0, 23.0, 24.0]]
], dtype=tf.float32)

ARGS = {
    "tensor": tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
get_normalization Ran
ran on a synthesized input
salu133445/dan/src/dan/presets/ops.py
code served (permissive licence) · get_code("6c50317414bf1d88")
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 tensorflow as tf
import numpy as np

# Test with different norm_type values
# The function takes norm_type and training parameters

# Create a simple test input tensor
test_input = tf.constant(np.random.randn(2, 4).astype(np.float32))

# Define ARGS dict with all parameters
ARGS = {
    'norm_type': 'batch_norm',
    'training': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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
load_component Ran
ran on a synthesized input
salu133445/dan/src/dan/utils.py
code served (permissive licence) · get_code("99d72493ce9b6a6c")
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 importlib
import sys
from unittest.mock import MagicMock

# Create a mock module structure to simulate dan.presets.component.name
mock_module = MagicMock()

# Create a mock class that will be returned by getattr
class MockComponentClass:
    def __init__(self):
        self.name = "MockComponent"

# Add the class to the mock module
mock_module.MockComponentClass = MockComponentClass

# Mock the import_module function to return our mock module
original_import = importlib.import_module

def mock_import_module(name):
    if name == 'dan.presets.component_name.module_name':
        return mock_module
    return original_import(name)

importlib.import_module = mock_import_module

ARGS = {
    'component': 'component_name',
    'name': 'module_name',
    'class_name': 'MockComponentClass'
}
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_data Ran
ran on a synthesized input
salu133445/dan/src/dan/data.py
code served (permissive licence) · get_code("437ca4ed58b40c6c")
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 (10, 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 numpy as np
import tempfile
import os

# Create a temporary .npy file with sample data
temp_dir = tempfile.mkdtemp()
npy_file = os.path.join(temp_dir, "test_data.npy")
sample_data = np.random.rand(10, 5).astype(np.float32)
np.save(npy_file, sample_data)

ARGS = {
    "data_source": "npy",
    "filename": npy_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
SharedArray, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (10, 5) — shape (10, 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
load_data_from_npy Ran
ran on a synthesized input
salu133445/dan/src/dan/data.py
code served (permissive licence) · get_code("d734bf997af678c8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import tempfile
import os

# Create a temporary numpy file for testing
temp_dir = tempfile.gettempdir()
temp_filename = os.path.join(temp_dir, "test_data.npy")

# Create sample data and save it
sample_data = np.random.randn(2, 4).astype(np.float32)
np.save(temp_filename, sample_data)

ARGS = {
    "filename": temp_filename
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (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
load_yaml Ran
ran on a synthesized input
salu133445/dan/src/dan/utils.py
code served (permissive licence) · get_code("e9b277604f711d0d")
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 yaml
import tempfile
import os

# Create a temporary YAML file
with tempfile.NamedTemporaryFile(mode='w', suffix='.yaml', delete=False) as f:
    yaml_content = {
        'key1': 'value1',
        'key2': 42,
        'nested': {
            'inner_key': 'inner_value',
            'inner_list': [1, 2, 3]
        }
    }
    yaml.dump(yaml_content, f)
    temp_yaml_file = f.name

try:
    ARGS = {
        'filename': temp_yaml_file
    }
finally:
    # Clean up will happen after the function executes
    pass
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — 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
set_data_shape Ran
ran on a synthesized input
salu133445/dan/src/dan/data.py
code served (permissive licence) · get_code("4e288115d85d7bcc")
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 MockTensorLike. 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

torch.manual_seed(0)

class MockTensorLike:
    """Mock object that has set_shape method."""
    def __init__(self, shape):
        self.shape = shape
        self._data = torch.randn(*shape)
    
    def set_shape(self, new_shape):
        """Set the shape of the data."""
        self.shape = new_shape

# Create a mock data object with set_shape method
data = MockTensorLike((2, 4))

# Define the data_shape parameter
data_shape = (2, 3)

ARGS = {
    "data": data,
    "data_shape": data_shape
}
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 MockTensorLike — a MockTensorLike output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockTensorLike 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
shift Ran
ran on a synthesized input
salu133445/dan/src/process_data.py
code served (permissive licence) · get_code("54aa94d3da1df967")
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 4, dtype family float, shape (2, 5, 5, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small 4D numpy array
# Shape: (batch=2, height=5, width=5, channels=4)
data = np.random.rand(2, 5, 5, 4).astype(np.float32)

# Define shift amounts
shift_x = 2
shift_y = 1

ARGS = {
    "data": data,
    "shift_x": shift_x,
    "shift_y": shift_y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 4, dtype family float, shape (2, 5, 5, 4) — shape (2, 5, 5, 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
classic_gan_losses Not yet run
unverified (harvested, no recorded run)
salu133445/dan/src/dan/losses.py
code served (permissive licence) · get_code("39a7b44290d7f7d6")
How it ran

no invocation recorded.

convconcat Not yet run
unverified (harvested, no recorded run)
salu133445/dan/src/dan/presets/ops.py
code served (permissive licence) · get_code("532ce6c3a951d80b")
How it ran

no invocation recorded.

get_adv_losses Not yet run
unverified (harvested, no recorded run)
salu133445/dan/src/dan/losses.py
code served (permissive licence) · get_code("7ebc66c169767bcf")
How it ran

no invocation recorded.

load_params Not yet run
unverified (harvested, no recorded run)
salu133445/dan/src/dan/utils.py
code served (permissive licence) · get_code("88a4709aadaa1849")
How it ran

no invocation recorded.

nonsaturating_gan_losses Not yet run
unverified (harvested, no recorded run)
salu133445/dan/src/dan/losses.py
code served (permissive licence) · get_code("d2616d28a605aeb3")
How it ran

no invocation recorded.

sn_conv2d Not yet run
unverified (harvested, no recorded run)
salu133445/dan/src/dan/presets/spectral_norm.py
code served (permissive licence) · get_code("d9d55b6590a04aee")
How it ran

no invocation recorded.

sn_dense Not yet run
unverified (harvested, no recorded run)
salu133445/dan/src/dan/presets/spectral_norm.py
code served (permissive licence) · get_code("1f9327121f6048f9")
How it ran

no invocation recorded.

spectral_normalize Not yet run
unverified (harvested, no recorded run)
salu133445/dan/src/dan/presets/spectral_norm.py
code served (permissive licence) · get_code("95cafc39c0a7381c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
classic_gan_losses 1 other paper
1 dated earlier
1804.09399 (2018-04)
Convolutional Generative Adversarial Networks with Binary Neurons for Polyphonic Music Generation
get_normalization 1 other paper
1 dated earlier
1804.09399 (2018-04)
Convolutional Generative Adversarial Networks with Binary Neurons for Polyphonic Music Generation
load_data_from_npy 1 other paper
1 dated earlier
1804.09399 (2018-04)
Convolutional Generative Adversarial Networks with Binary Neurons for Polyphonic Music Generation
load_params 1 other paper
1 dated earlier
1804.09399 (2018-04)
Convolutional Generative Adversarial Networks with Binary Neurons for Polyphonic Music Generation
load_yaml 1 other paper
1 dated earlier
1804.09399 (2018-04)
Convolutional Generative Adversarial Networks with Binary Neurons for Polyphonic Music Generation
nonsaturating_gan_losses 1 other paper
1 dated earlier
1804.09399 (2018-04)
Convolutional Generative Adversarial Networks with Binary Neurons for Polyphonic Music 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-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

Recent years have seen adversarial losses been applied to many fields. Their applications extend beyond the originally proposed generative modeling to conditional generative and discriminative settings. While prior work has proposed various output activation functions and regularization approaches, some open questions still remain unanswered. In this paper, we aim to study the following two research questions: 1) What types of output activation functions form a well-behaved adversarial loss? 2) How different combinations of output activation functions and regularization approaches perform empirically against one another? To answer the first question, we adopt the perspective of variational divergence minimization and consider an adversarial loss well-behaved if it behaves as a divergence-like measure between the data and model distributions. Using a generalized formulation for adversarial losses, we derive the necessary and sufficient conditions of a well-behaved adversarial loss. Our analysis reveals a large class of theoretically valid adversarial losses. For the second question, we propose a simple comparative framework for adversarial losses using discriminative adversarial networks. The proposed framework allows us to efficiently evaluate adversarial losses using a standard evaluation metric such as the classification accuracy. With the proposed framework, we evaluate a comprehensive set of 168 combinations of twelve output activation functions and fourteen regularization approaches on the handwritten digit classification problem to decouple their effects. Our empirical findings suggest that there is no single winning combination of output activation functions and regularization approaches across all settings. Our theoretical and empirical results may together serve as a reference for choosing or designing adversarial losses in future research.

For agents

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

get_harvested_code_for_paper("1901.08753")
get_code_for_paper("1901.08753")
have("1901.08753")

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

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

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

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

Connect an agent — have() is free.