SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1410.8516 · 2014

NICE: Non-linear Independent Components Estimation

Yoshua Bengio, David Krueger, Laurent Dinh

arXiv · PDF · Open in the Atlas

Code that ran

24 of 27 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (16 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 19 have no contract verdict; 5 failures of our instrument; 3 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/1410.8516.json · badge: /api/ran/1410.8516.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
jfcrenshaw/pzflow community
Papers with Code archive
6 ran · 1 no recorded run
paultsw/nice_pytorch community
Papers with Code archive
5 ran · 0 no recorded run
DakshIdnani/pytorch-nice community
Papers with Code archive
4 ran · 0 no recorded run
fmu2/NICE community
Papers with Code archive
3 ran · 0 no recorded run
g4vrel/simple_ml community
Papers with Code archive
2 ran · 1 no recorded run
vincentstimper/normalizing-flows community
Papers with Code archive
2 ran · 1 no recorded run
MaximeVandegar/Papers-in-100-Lines-of-Code community
Papers with Code archive
1 ran · 0 no recorded run
gmum/nice_pytorch community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
ACL Ran
ran on a synthesized input · constructed an object; no result was computed
g4vrel/simple_ml/NICE/nice.py
code served (permissive licence) · get_code("cdc21e5b776e57dd")
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, ACL: 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

torch.manual_seed(0)

# Define the hyperparameters used in the function
nh = 1000
nin = 784
nlayers = 5

# Build the MLP model
class MLP(nn.Module):
    def __init__(self, nin, nh):
        super().__init__()
        layers = [nn.Linear(nin, nh), nn.ReLU()]
        for _ in range(nlayers):
            layers += [nn.Linear(nh, nh), nn.ReLU()]
        layers += [nn.Linear(nh, nin)]
        self.net = nn.Sequential(*layers)

    def forward(self, x):
        return self.net(x)

# Build the ACL model
class ACL(nn.Module):
    def __init__(self, nin, nh, p):
        super().__init__()
        self.m = MLP(nin, nh)
        self.p = p
        self.nin = nin

    def forward(self, x):
        x1, x2 = (x[:, ::2], x[:, 1::2])
        if self.p:
            x1, x2 = (x2, x1)
        z1 = x1
        z2 = x2 + self.m(x1)
        if self.p:
            z1, z2 = (z2, z1)
        z = torch.empty(x.shape, device=x.device)
        z[:, ::2] = z1
        z[:, 1::2] = z2
        return z

    def backward(self, z):
        z1, z2 = (z[:, ::2], z[:, 1::2])
        if self.p:
            z1, z2 = (z2, z1)
        x1 = z1
        x2 = z2 - self.m(z1)
        if self.p:
            x1, x2 = (x2, x1)
        x = torch.empty(z.shape, device=z.device)
        x[:, ::2] = x1
        x[:, 1::2] = x2
        return x

# Create arguments for ACL
nin_arg = 4
nh_arg = 16
p_arg = False

ARGS = {
    'nin': nin_arg,
    'nh': nh_arg,
    'p': p_arg
}
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 ACL — 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 ACL 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
AdditiveCouplingLayer Ran
ran on a synthesized input · constructed an object; no result was computed
paultsw/nice_pytorch/nice/models.py
code served (permissive licence) · get_code("2a75e5263cb27fc7")
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, AdditiveCouplingLayer: 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

torch.manual_seed(0)

# The AdditiveCouplingLayer inherits from _BaseCouplingLayer and requires:
# - dim: dimension of the inputs
# - partition: 'even' or 'odd'
# - nonlinearity: an instance of torch.nn.Module

# Build a simple nonlinearity module
# Looking at the forward pass, it needs to accept input of shape (batch, dim//2) or (batch, (dim+1)//2)
# and output the same shape, since it's used in coupling_law(a, b) where both a and b should be compatible for addition
nonlinearity = nn.Sequential(
    nn.Linear(2, 3),
    nn.ReLU(),
    nn.Linear(3, 2)
)

ARGS = {
    'dim': 4,
    'partition': 'even',
    'nonlinearity': nonlinearity
}
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 AdditiveCouplingLayer — 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 AdditiveCouplingLayer 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
AffineCoupling Ran
ran on a synthesized input
vincentstimper/normalizing-flows/normflows/flows/affine/coupling.py
code served (permissive licence) · get_code("3c08d19a3ff50fa8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import nn

class Flow(nn.Module):
    """
    Generic class for flow functions
    """

    def __init__(self):
        super().__init__()

    def forward(self, z):
        """
        Args:
          z: input variable, first dimension is batch dim

        Returns:
          transformed z and log of absolute determinant
        """
        raise NotImplementedError('Forward pass has not been implemented.')

    def inverse(self, z):
        raise NotImplementedError('This flow has no algebraic inverse.')

def zero_log_det_like_z(z):
    return torch.zeros(z.shape[0], dtype=z.dtype, device=z.device)

class AffineCoupling(Flow):
    """
    Affine Coupling layer as introduced RealNVP paper, see arXiv: 1605.08803
    """

    def __init__(self, param_map, scale=True, scale_map='exp'):
        """Constructor

        Args:
          param_map: Maps features to shift and scale parameter (if applicable)
          scale: Flag whether scale shall be applied
          scale_map: Map to be applied to the scale parameter, can be 'exp' as in RealNVP or 'sigmoid' as in Glow, 'sigmoid_inv' uses multiplicative sigmoid scale when sampling from the model
        """
        super().__init__()
        self.add_module('param_map', param_map)
        self.scale = scale
        self.scale_map = scale_map

    def forward(self, z):
        """
        z is a list of z1 and z2; ```z = [z1, z2]
        z1 is left constant and affine map is applied to z2 with parameters depending
        on z1

        Args:
          z
        """
        z1, z2 = z
        param = self.param_map(z1)
        if self.scale:
            shift = param[:, 0::2, ...]
            scale_ = param[:, 1::2, ...]
            if self.scale_map == 'exp':
                z2 = z2 * torch.exp(scale_) + shift
                log_det = torch.sum(scale_, dim=list(range(1, shift.dim())))
            elif self.scale_map == 'sigmoid':
                scale = torch.sigmoid(scale_ + 2)
                z2 = z2 / scale + shift
                log_det = -torch.sum(torch.log(scale), dim=list(range(1, shift.dim())))
            elif self.scale_map == 'sigmoid_inv':
                scale = torch.sigmoid(scale_ + 2)
                z2 = z2 * scale + shift
                log_det = torch.sum(torch.log(scale), dim=list(range(1, shift.dim())))
            else:
                raise NotImplementedError('This scale map is not implemented.')
        else:
            z2 = z2 + param
            log_det = zero_log_det_like_z(z2)
        return ([z1, z2], log_det)

    def inverse(self, z):
        z1, z2 = z
        param = self.param_map(z1)
        if self.scale:
            shift = param[:, 0::2, ...]
            scale_ = param[:, 1::2, ...]
            if self.scale_map == 'exp':
                z2 = (z2 - shift) * torch.exp(-scale_)
                log_det = -torch.sum(scale_, dim=list(range(1, shift.dim())))
            elif self.scale_map == 'sigmoid':
                scale = torch.sigmoid(scale_ + 2)
                z2 = (z2 - shift) * scale
                log_det = torch.sum(torch.log(scale), dim=list(range(1, shift.dim())))
            elif self.scale_map == 'sigmoid_inv':
                scale = torch.sigmoid(scale_ + 2)
                z2 = (z2 - shift) / scale
                log_det = -torch.sum(torch.log(scale), dim=list(range(1, shift.dim())))
            else:
                raise NotImplementedError('This scale map is not implemented.')
        else:
            z2 = z2 - param
            log_det = zero_log_det_like_z(z2)
        return ([z1, z2], log_det)


param_map = nn.Sequential(
    nn.Linear(4, 8),
    nn.ReLU(),
    nn.Linear(8, 8)
)

INIT_ARGS = {
    'param_map': param_map,
    'scale': True,
    'scale_map': 'exp'
}

ARGS = {
    'z': [torch.randn(2, 4), torch.randn(2, 4)]
}

if __name__ == '__main__':
    model = AffineCoupling(**INIT_ARGS)
    output, log_det = model(ARGS['z'])
    print("Output shapes:", [o.shape for o in output])
    print("Log det shape:", log_det.shape)
    print("Forward pass successful")
    
    inv_output, inv_log_det = model.inverse(output)
    print("Inverse output shapes:", [o.shape for o in inv_output])
    print("Inverse log det shape:", inv_log_det.shape)
    print("Inverse pass successful")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Bijector Ran
ran on a synthesized input · constructed an object; no result was computed
jfcrenshaw/pzflow/pzflow/bijectors.py
code served (permissive licence) · get_code("3927f3ad56e8701b")
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, Bijector: 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 jax
import jax.numpy as jnp
from collections.abc import Callable

def dummy_bijector_func():
    """A simple bijector function that returns InitFunction and Bijector_Info."""
    
    def init_fn(rng, input_dim, **kwargs):
        """Initialize bijector parameters and return forward/inverse functions."""
        # Create simple parameters as a pytree (tuple of arrays)
        params = (jnp.ones((input_dim, input_dim)), jnp.zeros(input_dim))
        
        def forward_fn(params, inputs, **kwargs):
            """Forward pass: simple linear transformation."""
            W, b = params
            outputs = jnp.dot(inputs, W) + b
            # Log determinant of Jacobian (simplified)
            log_det = jnp.ones(inputs.shape[0]) * 0.5
            return outputs, log_det
        
        def inverse_fn(params, inputs, **kwargs):
            """Inverse pass: reverse transformation."""
            W, b = params
            outputs = jnp.dot(inputs - b, jnp.linalg.inv(W))
            log_det = jnp.ones(inputs.shape[0]) * -0.5
            return outputs, log_det
        
        forward_fun = ForwardFunction(forward_fn)
        inverse_fun = InverseFunction(inverse_fn)
        
        return params, forward_fun, inverse_fun
    
    bijector_info = ("linear_bijector", (4, 4))
    init_function = InitFunction(init_fn)
    
    return init_function, bijector_info

ARGS = {
    "func": dummy_bijector_func
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Bijector — 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 Bijector 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
Coupling Ran
ran on a synthesized input · constructed an object; no result was computed
fmu2/NICE/nice.py
code served (permissive licence) · get_code("feb422919519eb2a")
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, Coupling: 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

torch.manual_seed(0)

ARGS = {
    "in_out_dim": 4,
    "mid_dim": 8,
    "hidden": 2,
    "mask_config": 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 Coupling — 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 Coupling 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
CouplingLayer Ran
ran on a synthesized input · constructed an object; no result was computed
DakshIdnani/pytorch-nice/nice.py
code served (permissive licence) · get_code("a1e6e98c3d08e03f")
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, CouplingLayer: 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

torch.manual_seed(0)

# Examine the function signature and body:
# __init__(self, data_dim, hidden_dim, mask, num_layers=4)
# - data_dim: must be even (asserted), used for Linear layers
# - hidden_dim: dimension of hidden layers
# - mask: a tensor used in forward() via element-wise multiplication with x
# - num_layers: number of layers in the network (default 4)

# The forward method uses:
# - self.mask: element-wise multiplied with x (batch_size, data_dim)
# - self.m: a Sequential module applied to x1

data_dim = 4  # must be even
hidden_dim = 3
num_layers = 4

# Create mask: same shape as data will be (batch_size, data_dim)
# For additive coupling, mask is typically binary alternating pattern
mask = torch.tensor([[1.0, 0.0, 1.0, 0.0],
                     [1.0, 0.0, 1.0, 0.0]])  # shape (2, 4) for broadcasting

# However, mask should be a single tensor that broadcasts with input
# Looking at usage: self.mask * x and (1.0 - self.mask) * x
# This works best if mask is 1D or broadcastable
mask = torch.tensor([1.0, 0.0, 1.0, 0.0])  # shape (4,)

ARGS = {
    "data_dim": data_dim,
    "hidden_dim": hidden_dim,
    "mask": mask,
    "num_layers": num_layers,
}
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 CouplingLayer — 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 CouplingLayer 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
DenseReluNetwork Ran
ran; our contract draft was wrong, not the code
jfcrenshaw/pzflow/pzflow/bijectors.py
code served (permissive licence) · get_code("bdbe5e7ec83debb6")
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 jax
import jax.numpy as jnp

ARGS = {
    "out_dim": 5,
    "hidden_layers": 2,
    "hidden_dim": 8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — 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
ForwardFunction Ran
ran on a synthesized input · constructed an object; no result was computed
jfcrenshaw/pzflow/pzflow/bijectors.py
code served (permissive licence) · get_code("9d4c6ab46065ae74")
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, ForwardFunction: 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 jax.numpy as jnp
import jax

def create_simple_forward_function():
    """Create a simple forward bijection function."""
    def forward_bijection(params, inputs, **kwargs):
        # Simple linear transformation: outputs = params[0] * inputs + params[1]
        scale, shift = params
        outputs = scale * inputs + shift
        # Log determinant of Jacobian for diagonal scaling
        log_det = jnp.sum(jnp.log(jnp.abs(scale)))
        return outputs, log_det
    
    return forward_bijection

# Create the ForwardFunction instance
forward_func = create_simple_forward_function()

# Create params pytree (nested tuple structure)
# Using simple jnp arrays for scale and shift
params = (
    jnp.array([2.0, 3.0, 1.5, 2.5]),  # scale parameters
    jnp.array([0.1, 0.2, 0.3, 0.4])   # shift parameters
)

# Create inputs tensor (batch_size=2, dim=4)
inputs = jnp.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
])

# Create the ForwardFunction instance
from collections.abc import Callable

class ForwardFunction:
    def __init__(self, func: Callable) -> None:
        self._func = func

    def __call__(self, params, inputs, **kwargs):
        return self._func(params, inputs, **kwargs)

forward_function_instance = ForwardFunction(forward_func)

ARGS = {
    "func": forward_func
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ForwardFunction — 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 ForwardFunction 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
InitFunction Ran
ran on a synthesized input · constructed an object; no result was computed
jfcrenshaw/pzflow/pzflow/bijectors.py
code served (permissive licence) · get_code("7e3e6278ac1d8af6")
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, InitFunction: 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 jax
import jax.numpy as jnp
from collections.abc import Callable

def dummy_init_func(rng: jnp.ndarray, input_dim: int, **kwargs) -> tuple:
    """Dummy initialization function that returns params, forward_fun, and inverse_fun."""
    # Create simple parameters as a pytree (tuple of arrays)
    params = (jnp.array([0.5, 0.3]), jnp.array([0.1, 0.2, 0.15, 0.25]))
    
    def forward_impl(params: tuple, inputs: jnp.ndarray, **kwargs) -> tuple:
        """Simple forward bijection: scale and shift."""
        scale_params, shift_params = params
        outputs = inputs * scale_params[0] + shift_params[:inputs.shape[-1]]
        log_det = jnp.sum(jnp.log(jnp.abs(scale_params[0])) * jnp.ones(inputs.shape[0]))
        return outputs, log_det
    
    def inverse_impl(params: tuple, inputs: jnp.ndarray, **kwargs) -> tuple:
        """Simple inverse bijection."""
        scale_params, shift_params = params
        outputs = (inputs - shift_params[:inputs.shape[-1]]) / scale_params[0]
        log_det = -jnp.sum(jnp.log(jnp.abs(scale_params[0])) * jnp.ones(inputs.shape[0]))
        return outputs, log_det
    
    from __main__ import ForwardFunction, InverseFunction
    forward_fun = ForwardFunction(forward_impl)
    inverse_fun = InverseFunction(inverse_impl)
    
    return params, forward_fun, inverse_fun


# Create a PRNGKey for JAX
rng_key = jax.random.PRNGKey(0)

# Input dimension for the bijection
input_dim = 4

ARGS = {
    "func": dummy_init_func,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
__main__, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type InitFunction — 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 InitFunction 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
InverseFunction Ran
ran on a synthesized input · constructed an object; no result was computed
jfcrenshaw/pzflow/pzflow/bijectors.py
code served (permissive licence) · get_code("e19df3b31e4e1bd2")
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, InverseFunction: 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 jax.numpy as jnp
import numpy as np
from collections.abc import Callable

# Define a simple bijection function for testing
def simple_bijection_func(params, inputs, **kwargs):
    """A minimal bijection function that returns outputs and log_det."""
    # params is expected to be a pytree (tuple/list of parameters)
    scale = params[0]
    
    # Simple linear transformation: y = scale * x
    outputs = scale * inputs
    
    # Log determinant for a diagonal scaling: log|det(J)| = sum(log|scale|))
    batch_size = inputs.shape[0]
    log_det = jnp.sum(jnp.log(jnp.abs(scale))) * jnp.ones(batch_size)
    
    return outputs, log_det

# Create example inputs
np.random.seed(0)
inputs = jnp.array(np.random.randn(2, 4).astype(np.float32))

# Create params as a Pytree (tuple of arrays)
scale_param = jnp.array([1.5, 2.0, 1.2, 0.8], dtype=jnp.float32)
params = (scale_param,)

# Create the InverseFunction instance
func = simple_bijection_func

ARGS = {
    "func": func
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type InverseFunction — 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 InverseFunction 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
LogisticDistribution Ran
ran on a synthesized input · constructed an object; no result was computed
DakshIdnani/pytorch-nice/nice.py
code served (permissive licence) · get_code("5d1d5872e739c007")
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, LogisticDistribution: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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.functional as F
from torch.distributions import Distribution, Uniform

torch.manual_seed(0)

ARGS = {}
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 LogisticDistribution — 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 LogisticDistribution 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
MLP Ran
ran on a synthesized input · constructed an object; no result was computed
g4vrel/simple_ml/NICE/nice.py
code served (permissive licence) · get_code("33b882451180d1c9")
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, MLP: 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

torch.manual_seed(0)

nh = 1000
nin = 784
nlayers = 5

ARGS = {
    'nin': 784,
    'nh': 1000,
}
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 MLP — 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 MLP 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
NICE Ran
ran on a synthesized input · constructed an object; no result was computed
fmu2/NICE/nice.py
code served (permissive licence) · get_code("b95df537e4a2a1f4")
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, NICE: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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.distributions as dist

torch.manual_seed(0)

# Create a simple prior distribution
class SimplePrior:
    def __init__(self, dim):
        self.dim = dim
        self.standard_normal = dist.Normal(torch.zeros(dim), torch.ones(dim))
    
    def log_prob(self, z):
        return self.standard_normal.log_prob(z)
    
    def sample(self, size):
        if isinstance(size, tuple):
            return self.standard_normal.sample(size)
        else:
            return self.standard_normal.sample((size,))

# Set parameters
in_out_dim = 4
mid_dim = 3
hidden = 2
coupling_layers = 2
mask_config = 0

# Create prior
prior = SimplePrior(in_out_dim)

ARGS = {
    "prior": prior,
    "coupling": coupling_layers,
    "in_out_dim": in_out_dim,
    "mid_dim": mid_dim,
    "hidden": hidden,
    "mask_config": mask_config
}
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 NICE — 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 NICE 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
NICE Ran
ran on a synthesized input · constructed an object; no result was computed
DakshIdnani/pytorch-nice/nice.py
code served (permissive licence) · get_code("797c85f9a30a07bd")
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, NICE: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np
from torch.distributions import Distribution, Uniform

torch.manual_seed(0)

# Override cfg to use CPU
cfg = {
    'MODEL_SAVE_PATH': './saved_models/',
    'USE_CUDA': False,
    'TRAIN_BATCH_SIZE': 256,
    'TRAIN_EPOCHS': 75,
    'NUM_COUPLING_LAYERS': 4,
    'NUM_NET_LAYERS': 6,
    'NUM_HIDDEN_UNITS': 1000
}

ARGS = {
    'data_dim': 4,
    'num_coupling_layers': 2
}
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 NICE — 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 NICE 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
NICE Ran
ran on a synthesized input
MaximeVandegar/Papers-in-100-Lines-of-Code/NICE_Non_linear_Independent_Components_Estimation/NICE.py
code served (permissive licence) · get_code("1a1bcb9945e07fb5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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

class NICE(nn.Module):

    def __init__(self, data_dim=28 * 28, hidden_dim=1000):
        super().__init__()
        self.m = torch.nn.ModuleList([nn.Sequential(nn.Linear(data_dim // 2, hidden_dim), nn.ReLU(), nn.Linear(hidden_dim, hidden_dim), nn.ReLU(), nn.Linear(hidden_dim, hidden_dim), nn.ReLU(), nn.Linear(hidden_dim, hidden_dim), nn.ReLU(), nn.Linear(hidden_dim, hidden_dim), nn.ReLU(), nn.Linear(hidden_dim, data_dim // 2)) for i in range(4)])
        self.s = torch.nn.Parameter(torch.randn(data_dim))

    def forward(self, x):
        x = x.clone()
        for i in range(len(self.m)):
            x_i1 = x[:, ::2] if i % 2 == 0 else x[:, 1::2]
            x_i2 = x[:, 1::2] if i % 2 == 0 else x[:, ::2]
            h_i1 = x_i1
            h_i2 = x_i2 + self.m[i](x_i1)
            x = torch.empty(x.shape, device=x.device)
            x[:, ::2] = h_i1
            x[:, 1::2] = h_i2
        z = torch.exp(self.s) * x
        log_jacobian = torch.sum(self.s)
        return (z, log_jacobian)

    def invert(self, z):
        x = z.clone() / torch.exp(self.s)
        for i in range(len(self.m) - 1, -1, -1):
            h_i1 = x[:, ::2]
            h_i2 = x[:, 1::2]
            x_i1 = h_i1
            x_i2 = h_i2 - self.m[i](x_i1)
            x = torch.empty(x.shape, device=x.device)
            x[:, ::2] = x_i1 if i % 2 == 0 else x_i2
            x[:, 1::2] = x_i2 if i % 2 == 0 else x_i1
        return x


INIT_ARGS = {
    'data_dim': 4,
    'hidden_dim': 8,
}

ARGS = {
    'x': torch.randn(2, 4),
}

if __name__ == '__main__':
    model = NICE(**INIT_ARGS)
    z, log_jacobian = model(**ARGS)
    print(f"Output z shape: {z.shape}")
    print(f"Log jacobian: {log_jacobian}")
    
    x_reconstructed = model.invert(z)
    print(f"Reconstructed x shape: {x_reconstructed.shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
NICEModel Ran
ran on a synthesized input · constructed an object; no result was computed
paultsw/nice_pytorch/nice/models.py
code served (permissive licence) · get_code("288bd9ac482f455f")
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, NICEModel: 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

torch.manual_seed(0)

ARGS = {
    'input_dim': 4,
    'hidden_dim': 8,
    'num_layers': 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 NICEModel — 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 NICEModel 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
NICEModel Ran
ran on a synthesized input · constructed an object; no result was computed
gmum/nice_pytorch/nice/models.py
code served (permissive licence) · get_code("7e47833eba9e3d69")
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, NICEModel: 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

torch.manual_seed(0)

# NICEModel expects:
# - input_dim: int, dimension of inputs (must be even)
# - hidden_dim: int, hidden dimension for the ReLU networks
# - num_layers: int, number of layers in the ReLU networks

ARGS = {
    'input_dim': 4,
    'hidden_dim': 8,
    'num_layers': 2
}
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 NICEModel — 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 NICEModel 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
RationalQuadraticSpline Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jfcrenshaw/pzflow/pzflow/bijectors.py
code served (permissive licence) · get_code("d1680a8d472444f5")
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 jax.numpy as jnp
import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small tensors for testing
batch_size = 2
num_bins = 4
feature_dim = 3

# inputs: shape (batch_size, feature_dim)
inputs = jnp.array(np.random.uniform(-0.5, 0.5, size=(batch_size, feature_dim)), dtype=jnp.float32)

# W: widths of spline bins, shape (batch_size, feature_dim, num_bins)
W = jnp.array(np.random.uniform(0.1, 0.3, size=(batch_size, feature_dim, num_bins)), dtype=jnp.float32)
W = W / W.sum(axis=-1, keepdims=True)  # normalize so they sum to 1

# H: heights of spline bins, shape (batch_size, feature_dim, num_bins)
H = jnp.array(np.random.uniform(0.1, 0.3, size=(batch_size, feature_dim, num_bins)), dtype=jnp.float32)
H = H / H.sum(axis=-1, keepdims=True)  # normalize so they sum to 1

# D: derivatives at inner knots, shape (batch_size, feature_dim, num_bins - 1)
D = jnp.array(np.random.uniform(0.5, 1.5, size=(batch_size, feature_dim, num_bins - 1)), dtype=jnp.float32)

# B: range of splines (scalar float)
B = 3.0

# periodic: boolean flag
periodic = False

# inverse: boolean flag
inverse = False

ARGS = {
    "inputs": inputs,
    "W": W,
    "H": H,
    "D": D,
    "B": B,
    "periodic": periodic,
    "inverse": inverse,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — 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
Scaling Ran
ran on a synthesized input · constructed an object; no result was computed
fmu2/NICE/nice.py
code served (permissive licence) · get_code("618382e0d811f2d8")
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, Scaling: 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

torch.manual_seed(0)

ARGS = {
    "dim": 4
}
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 Scaling — 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 Scaling 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
ScalingLayer Ran
ran on a synthesized input
DakshIdnani/pytorch-nice/nice.py
code served (permissive licence) · get_code("73acddb22c061b6a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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

class ScalingLayer(nn.Module):
    """
  Implementation of the scaling layer from section 3.3 of the NICE paper.
  """

    def __init__(self, data_dim):
        super().__init__()
        self.log_scale_vector = nn.Parameter(torch.randn(1, data_dim, requires_grad=True))

    def forward(self, x, logdet, invert=False):
        log_det_jacobian = torch.sum(self.log_scale_vector)
        if invert:
            return (torch.exp(-self.log_scale_vector) * x, logdet - log_det_jacobian)
        return (torch.exp(self.log_scale_vector) * x, logdet + log_det_jacobian)


INIT_ARGS = {
    'data_dim': 4
}

ARGS = {
    'x': torch.randn(2, 4),
    'logdet': torch.tensor(0.0),
    'invert': False
}

if __name__ == '__main__':
    layer = ScalingLayer(**INIT_ARGS)
    output = layer(**ARGS)
    print("Output:", output)
    print("Output shapes:", output[0].shape, output[1].shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
_BaseCouplingLayer Ran
ran on a synthesized input · constructed an object; no result was computed
paultsw/nice_pytorch/nice/models.py
code served (permissive licence) · get_code("ede51f79ec51199b")
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, _BaseCouplingLayer: 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

torch.manual_seed(0)

# Create a simple nonlinearity module that will be called in the forward/inverse methods
class SimpleNonlinearity(nn.Module):
    def __init__(self):
        super(SimpleNonlinearity, self).__init__()
        self.linear = nn.Linear(2, 2)
    
    def forward(self, x):
        return self.linear(x)

# Define the arguments for _BaseCouplingLayer
ARGS = {
    'dim': 4,
    'partition': 'even',
    'nonlinearity': SimpleNonlinearity()
}
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 _BaseCouplingLayer — 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 _BaseCouplingLayer output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_build_relu_network Ran
ran; our contract draft was wrong, not the code
paultsw/nice_pytorch/nice/models.py
code served (permissive licence) · get_code("419f30152991aee7")
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

torch.manual_seed(0)

# Construct valid arguments for _build_relu_network
ARGS = {
    "latent_dim": 4,
    "hidden_dim": 8,
    "num_layers": 2
}
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 — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
_interleave Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
paultsw/nice_pytorch/nice/models.py
code served (permissive licence) · get_code("acffc3df688ea63f")
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, 7) 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 two rank-2 tensors with the same batch dimension
# first: shape (B, M), second: shape (B, N) where M = N or N+1
batch_size = 2
first = torch.randn(batch_size, 4)  # (2, 4)
second = torch.randn(batch_size, 3)  # (2, 3) - N+1 case where N=3, M=4

order = 'even'

ARGS = {
    'first': first,
    'second': second,
    'order': order
}
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, 7) — shape (2, 7) 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
zero_log_det_like_z Ran
ran; our contract draft was wrong, not the code
vincentstimper/normalizing-flows/normflows/flows/affine/coupling.py
code served (permissive licence) · get_code("3c2a36e9a28c16f0")
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 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 torch

torch.manual_seed(0)

# Create a small tensor with batch size 2 and feature dimension 4
z = torch.randn(2, 4, dtype=torch.float32)

ARGS = {
    "z": z
}
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 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
Flow Not yet run
unverified (harvested, no recorded run)
vincentstimper/normalizing-flows/normflows/flows/affine/coupling.py
code served (permissive licence) · get_code("5886cd39dfbd797e")
How it ran

no invocation recorded.

NICE Not yet run
unverified (harvested, no recorded run)
g4vrel/simple_ml/NICE/nice.py
code served (permissive licence) · get_code("8fca3630fcfef7f1")
How it ran

no invocation recorded.

NeuralSplineCoupling Not yet run
unverified (harvested, no recorded run)
jfcrenshaw/pzflow/pzflow/bijectors.py
code served (permissive licence) · get_code("d79d72f0b9ce6c77")
How it ran

no invocation recorded.

Also present in other papers' code

Of 27 samples lifted from this paper's linked repositories, 27 carry a function identity and 0 do not. Of the 27 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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

We propose a deep learning framework for modeling complex high-dimensional densities called Non-linear Independent Component Estimation (NICE). It is based on the idea that a good representation is one in which the data has a distribution that is easy to model. For this purpose, a non-linear deterministic transformation of the data is learned that maps it to a latent space so as to make the transformed data conform to a factorized distribution, i.e., resulting in independent latent variables. We parametrize this transformation so that computing the determinant of the Jacobian and inverse Jacobian is trivial, yet we maintain the ability to learn complex non-linear transformations, via a composition of simple building blocks, each based on a deep neural network. The training criterion is simply the exact log-likelihood, which is tractable. Unbiased ancestral sampling is also easy. We show that this approach yields good generative models on four image datasets and can be used for inpainting.

For agents

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

get_harvested_code_for_paper("1410.8516")
get_code_for_paper("1410.8516")
have("1410.8516")

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

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

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

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

Connect an agent — have() is free.