SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.08052 · 2021

Moser Flow: Divergence-based Generative Modeling on Manifolds

arXiv · PDF · Open in the Atlas

Code that ran

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

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2108.08052.json · badge: /api/ran/2108.08052.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
noamroze/moser_flow canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
build_mlp Ran
ran on a synthesized input
noamroze/moser_flow/common/architectures.py
code served (permissive licence) · get_code("afc8000701215633")
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)

# Define arguments for build_mlp
input_dim = 4
hidden_dims = [8, 16, 12]
output_dim = 3
activation = nn.ReLU()
last_activation = nn.Sigmoid()
add_batchnorm = True

ARGS = {
    "input_dim": input_dim,
    "hidden_dims": hidden_dims,
    "output_dim": output_dim,
    "activation": activation,
    "last_activation": last_activation,
    "add_batchnorm": add_batchnorm,
}
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
exact_divergence Ran
ran on a synthesized input
noamroze/moser_flow/common/estimators.py
code served (permissive licence) · get_code("b66e58e39476d143")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (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)

# The function expects:
# - f: either a callable that takes x and returns a tensor, or a tensor directly
# - x: a tensor with requires_grad=True (or it will be set), shape (batch_size, dim)

# Create a small input tensor: batch size 2, dimension 4
x = torch.randn(2, 4, requires_grad=True)

# Create a function f that takes x and returns a tensor of shape (batch_size, dim)
# The function computes f_x[:, i].sum() for each i, so f must output (batch_size, dim)
def f(x):
    # Simple function: element-wise operation that preserves shape
    return x ** 2 + 2 * x

ARGS = {
    "f": f,
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (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_train_metrics Ran
ran on a synthesized input
noamroze/moser_flow/evaluate_time.py
code served (permissive licence) · get_code("0fe9dd806a092065")
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 os
import tempfile
import shutil

# Create a temporary directory structure with a log file
temp_dir = tempfile.mkdtemp()
logs_dir = os.path.join(temp_dir, 'logs_dir')
os.makedirs(logs_dir, exist_ok=True)

# Create a training log file with sample data
log_path = os.path.join(logs_dir, 'training.log')
log_content = """epoch: 1.0, nll: 2.5, total_time: 10.5, cummulative_training_time: 5.2, training_step_time: 0.05
epoch: 2.0, nll: 2.3, total_time: 21.0, cummulative_training_time: 10.8, training_step_time: 0.048
validation epoch: 2.0, nll: 2.4
epoch: 3.0, nll: 2.1, total_time: 31.5, cummulative_training_time: 16.5, training_step_time: 0.047

"""

with open(log_path, 'w') as f:
    f.write(log_content)

ARGS = {
    'run_dir': temp_dir
}
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 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
get_val_metrics Ran
ran on a synthesized input
noamroze/moser_flow/evaluate_time.py
code served (permissive licence) · get_code("8fce565bb01c92df")
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 os
import tempfile
import shutil

# Create a temporary directory structure with a mock log file
temp_dir = tempfile.mkdtemp()
logs_dir = os.path.join(temp_dir, 'logs_dir')
os.makedirs(logs_dir, exist_ok=True)

# Create a training.log file with validation entries
log_content = """epoch 0, step 10, nll: 2.5, total_time: 5.2
epoch 1, validation step: 100, nll: 2.3, total_time: 10.5
epoch 2, validation step: 200, nll: 2.1, total_time: 15.8
epoch 3, validation step: 300, nll: 2.0, total_time: 21.2
"""

log_path = os.path.join(logs_dir, 'training.log')
with open(log_path, 'w') as f:
    f.write(log_content)

ARGS = {
    'run_dir': temp_dir
}
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 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
parse_activation Ran
ran on a synthesized input
noamroze/moser_flow/common/architectures.py
code served (permissive licence) · get_code("f27216ea9fe2e0a5")
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 Tanh. 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)

ACTIVATIONS = {
    'tanh': nn.Tanh(),
    'softplus': nn.Softplus(),
    'softplus100': nn.Softplus(100),
    'softplus200': nn.Softplus(200),
    'relu': nn.ReLU()
}

ARGS = {
    'activation_name': 'tanh'
}
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 Tanh — a Tanh output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Tanh 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
slice_size Ran
ran on a synthesized input
noamroze/moser_flow/datasets.py
code served (permissive licence) · get_code("720fe92efdb3bac0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family 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

torch.manual_seed(0)

# Test case 1: Boolean tensor index
bool_tensor = torch.tensor([True, False, True, True])
list_len_1 = 4

# Test case 2: Integer tensor index
int_tensor = torch.tensor([0, 2, 3])
list_len_2 = 5

# Test case 3: Slice object
slice_obj = slice(1, 8, 2)
list_len_3 = 10

# We need to test each case separately since the function takes different types
# Let's use the boolean tensor case as the primary ARGS
ARGS = {
    "index": bool_tensor,
    "list_len": list_len_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 Tensor, 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
evaluate_checkpoints Not yet run
unverified (harvested, no recorded run)
noamroze/moser_flow/evaluate_time.py
code served (permissive licence) · get_code("fc72d67983e81dbc")
How it ran

no invocation recorded.

evaluate_checkpoints Not yet run
unverified (harvested, no recorded run)
noamroze/moser_flow/run_statistical_experiment.py
code served (permissive licence) · get_code("f8e51601051c0f50")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 8 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-21.

Repositories linked to this paper

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

Abstract

We are interested in learning generative models for complex geometries described via manifolds, such as spheres, tori, and other implicit surfaces. Current extensions of existing (Euclidean) generative models are restricted to specific geometries and typically suffer from high computational costs. We introduce Moser Flow (MF), a new class of generative models within the family of continuous normalizing flows (CNF). MF also produces a CNF via a solution to the change-of-variable formula, however differently from other CNF methods, its model (learned) density is parameterized as the source (prior) density minus the divergence of a neural network (NN). The divergence is a local, linear differential operator, easy to approximate and calculate on manifolds. Therefore, unlike other CNFs, MF does not require invoking or backpropagating through an ODE solver during training. Furthermore, representing the model density explicitly as the divergence of a NN rather than as a solution of an ODE facilitates learning high fidelity densities. Theoretically, we prove that MF constitutes a universal density approximator under suitable assumptions. Empirically, we demonstrate for the first time the use of flow models for sampling from general curved surfaces and achieve significant improvements in density estimation, sample quality, and training complexity over existing CNFs on challenging synthetic geometries and real-world benchmarks from the earth and climate sciences.

For agents

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

get_harvested_code_for_paper("2108.08052")
get_code_for_paper("2108.08052")
have("2108.08052")

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

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

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

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

Connect an agent — have() is free.