SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.02731 · 2020

SurVAE Flows: Surjections to Bridge the Gap between VAEs and Flows

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 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 7 have no contract verdict; 3 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2007.02731.json · badge: /api/ran/2007.02731.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
didriknielsen/survae_flows canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
ramonpeter/elsa community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
revsic/tf-survae-flows community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
FunctionStatusWhere it lives
act_factor Ran
ran on a synthesized input
didriknielsen/survae_flows/survae/nn/layers/activations_factory.py
code served (permissive licence) · get_code("6eb70245806e4ae4")
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 int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function act_factor takes two parameters:
# 1. act_str: a string representing activation function
# 2. allow_concat: a boolean flag to allow concatenation activations

# Based on the function body, we need to provide valid values for both parameters

# Test case 1: Basic activation without concat allowed
ARGS = {
    'act_str': 'relu',
    'allow_concat': False
}
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 int, ndim 0, dtype family int, 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
elbo_nats Ran
ran; our contract draft was wrong, not the code
didriknielsen/survae_flows/survae/utils/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from craymichael/ProtoFlow, is pointer only (licence: GPL-2.0) · get_code("d232e453e386a533")
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 craymichael/ProtoFlow, and GPL-2.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

interpret_array Ran
ran on a synthesized input
ramonpeter/elsa/elsa/mappings/helper.py
code served (permissive licence) · get_code("33374fb83c4aaff3")
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 (4, 1) 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

# Test case 1: 1D array with ndim=None (should add newaxis)
array_1d = np.array([1, 2, 3, 4])
ndim_none = None

# Test case 2: 1D array with ndim=1
array_1d_single = np.array([5, 6, 7])
ndim_one = 1

# Test case 3: 1D array with ndim matching size
array_1d_sized = np.array([8, 9, 10, 11])
ndim_sized = 4

# Test case 4: 2D array with matching ndim
array_2d = np.array([[1, 2, 3], [4, 5, 6]])
ndim_matching = 3

# Choose one valid configuration for ARGS
ARGS = {
    'array': np.array([1.0, 2.0, 3.0, 4.0]),
    'ndim': None
}
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 (4, 1) — shape (4, 1) 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
loglik_bpd Ran
ran; our contract draft was wrong, not the code
didriknielsen/survae_flows/survae/utils/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from craymichael/ProtoFlow, is pointer only (licence: GPL-2.0) · get_code("9f24b4c6cbb5e19f")
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 craymichael/ProtoFlow, and GPL-2.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

loglik_nats Ran
ran; our contract draft was wrong, not the code
didriknielsen/survae_flows/survae/utils/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from craymichael/ProtoFlow, is pointer only (licence: GPL-2.0) · get_code("9bff0117086fa0a0")
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 craymichael/ProtoFlow, and GPL-2.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

map_fourvector_rambo Ran
ran on a synthesized input
ramonpeter/elsa/elsa/mappings/helper.py
code served (permissive licence) · get_code("1f52c85a53a421d0")
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 (2, 3, 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

# The function takes xs as input, which is a 3D numpy array
# It performs operations on xs[:, :, 0], xs[:, :, 1], xs[:, :, 2], xs[:, :, 3]
# So xs should have shape (batch_size, num_points, 4) with values in [0, 1] for RAMBO sampling

np.random.seed(0)

# Create a small sample: batch size 2, num_points 3, feature dimension 4
# Values should be in [0, 1] range as these represent unit hypercube points
xs = np.random.uniform(0, 1, size=(2, 3, 4)).astype(np.float64)

ARGS = {
    "xs": xs
}
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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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
mean_except_batch Ran
ran on a synthesized input
revsic/tf-survae-flows/survaeflow/utils.py
code served (permissive licence) · get_code("95a17905907a83b0")
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 tensorflow as tf
import numpy as np

# Create a small test tensor with shape [B, ...] where B=2 is batch dimension
# Using shape [2, 4, 3] to have distinct dimensions
batch_size = 2
inputs = tf.constant(np.random.randn(batch_size, 4, 3).astype(np.float32))

ARGS = {
    "inputs": inputs
}
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
save_distribution Ran
ran on a synthesized input
ramonpeter/elsa/elsa/utils/plots.py
code served (permissive licence) · get_code("c610476ce81501d8")
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, 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 numpy as np

# Analyze the function to understand what args contains:
# args[0] - appears to be a scalar (used in range specification)
# args[1] - appears to be a callable function (applied to y_train and y_predict)
# args[2] - appears to be an integer (number of histogram bins)
# args[3] - appears to be a tuple for range specification

# Create sample data
y_train = np.random.randn(100)
y_predict = np.random.randn(100)

# args[0]: a scalar value (e.g., for range offset or normalization)
arg0 = 0.0

# args[1]: a callable that takes data and a scalar parameter
# Based on usage: args[1](y_train, args[0]), it should return an array
def transform_fn(data, scalar):
    """Simple transformation function that adds the scalar to data"""
    return data + scalar

arg1 = transform_fn

# args[2]: number of histogram bins
arg2 = 10

# args[3]: range tuple for histogram (min, max)
arg3 = (-3.0, 3.0)

ARGS = {
    'y_train': y_train,
    'y_predict': y_predict,
    'args': [arg0, arg1, arg2, arg3]
}
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 (10, 3) — shape (10, 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
sum_except_batch Ran
ran on a synthesized input
revsic/tf-survae-flows/survaeflow/utils.py
code served (permissive licence) · get_code("d29caa5dfe0cdcf7")
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 tensorflow as tf
import numpy as np

# Create a small test tensor with batch size 2 and additional dimensions
# Shape: [B, D1, D2] = [2, 3, 4]
inputs = tf.constant(np.random.randn(2, 3, 4), dtype=tf.float32)

ARGS = {
    "inputs": inputs
}
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
two_body_decay_factor Ran
ran on a synthesized input
ramonpeter/elsa/elsa/mappings/helper.py
code served (permissive licence) · get_code("cecf8ebf923a66fd")
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 float64, ndim 0, 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 numpy as np

# Analyze the function to understand parameter types:
# - M_i_minus_1: used in arithmetic operations (**, +, -, sqrt) -> numeric scalar or array
# - M_i: used in arithmetic operations -> numeric scalar or array
# - m_i_minus_1: used in arithmetic operations -> numeric scalar or array

# The function performs two-body decay calculations from particle physics
# These are typically scalar or small array values representing masses

# Create scalar numpy values for a valid two-body decay scenario
# For a valid decay, we need: M_i_minus_1 > M_i + m_i_minus_1
# Example: parent mass 5, daughter mass 3, other particle mass 1
# Check: 5 > 3 + 1 = 4, and 5 > |3 - 1| = 2, so valid

M_i_minus_1 = np.float64(5.0)  # Parent particle mass
M_i = np.float64(3.0)           # Daughter particle mass
m_i_minus_1 = np.float64(1.0)   # Other particle mass

ARGS = {
    "M_i_minus_1": M_i_minus_1,
    "M_i": M_i,
    "m_i_minus_1": m_i_minus_1,
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 7 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
elbo_nats 3 other papers
3 later
2106.06245 (2021-06)
Model Selection for Bayesian Autoencoders
2305.04111 (2023-05)
Efficient and Degree-Guided Graph Generation via Discrete Diffusion Modeling
2407.12200 (2024-07)
This Probably Looks Exactly Like That: An Invertible Prototypical Network
loglik_nats 3 other papers
3 later
2106.06245 (2021-06)
Model Selection for Bayesian Autoencoders
2305.04111 (2023-05)
Efficient and Degree-Guided Graph Generation via Discrete Diffusion Modeling
2407.12200 (2024-07)
This Probably Looks Exactly Like That: An Invertible Prototypical Network
loglik_bpd 2 other papers
2 later
2106.06245 (2021-06)
Model Selection for Bayesian Autoencoders
2407.12200 (2024-07)
This Probably Looks Exactly Like That: An Invertible Prototypical Network

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

Normalizing flows and variational autoencoders are powerful generative models that can represent complicated density functions. However, they both impose constraints on the models: Normalizing flows use bijective transformations to model densities whereas VAEs learn stochastic transformations that are non-invertible and thus typically do not provide tractable estimates of the marginal likelihood. In this paper, we introduce SurVAE Flows: A modular framework of composable transformations that encompasses VAEs and normalizing flows. SurVAE Flows bridge the gap between normalizing flows and VAEs with surjective transformations, wherein the transformations are deterministic in one direction -- thereby allowing exact likelihood computation, and stochastic in the reverse direction -- hence providing a lower bound on the corresponding likelihood. We show that several recently proposed methods, including dequantization and augmented normalizing flows, can be expressed as SurVAE Flows. Finally, we introduce common operations such as the max value, the absolute value, sorting and stochastic permutation as composable layers in SurVAE Flows.

For agents

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

get_harvested_code_for_paper("2007.02731")
get_code_for_paper("2007.02731")
have("2007.02731")

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

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

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

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

Connect an agent — have() is free.