SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2102.05379 · NeurIPS · 2021

Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions

Max Welling, Emiel Hoogeboom, Didrik Nielsen, Priyank Jaini, Patrick Forré

arXiv · PDF · Open in the Atlas

Code that ran

14 of 20 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 7 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 5 failures of our instrument; 6 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2102.05379.json · badge: /api/ran/2102.05379.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/argmax_flows canonical (classifier label)
classifier basis: classifier_2025
8 ran · 3 no recorded run
ehoogeboom/multinomial_diffusion canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
YuzheZhang-1999/DiffTSR community
Papers with Code archive
5 ran · 2 no recorded run
TrentBrick/PyTorchDiscreteFlows community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
MultinomialDiffusion Ran
ran on a synthesized input · constructed an object; no result was computed
ehoogeboom/multinomial_diffusion/diffusion_utils/diffusion_multinomial.py
pointer only (licence: NONE) · get_code("4268dcf6913cd21f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ehoogeboom/multinomial_diffusion when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

_log_cdf Ran
ran, honoured the contract we drafted
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("e72047c1892c7a2a")
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, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for the function parameters
x = torch.randn(2, 4)  # batch size 2, dim 4
mean = torch.randn(2, 4)  # same shape as x
log_scale = torch.randn(2, 4)  # same shape as x

ARGS = {
    "x": x,
    "mean": mean,
    "log_scale": log_scale,
}
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, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_log_pdf Ran
ran, honoured the contract we drafted
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("74b5245783db5aab")
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, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for the logistic distribution log PDF
# x: input values (batch_size=2, features=4)
x = torch.randn(2, 4)

# mean: mean parameter (batch_size=2, features=4)
mean = torch.randn(2, 4)

# log_scale: log of scale parameter (batch_size=2, features=4)
log_scale = torch.randn(2, 4)

ARGS = {
    "x": x,
    "mean": mean,
    "log_scale": log_scale,
}
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, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cosine_beta_schedule Ran
ran, honoured the contract we drafted
YuzheZhang-1999/DiffTSR/model/TDM/models/diffusion_multinomial.py
code served (permissive licence) · get_code("c92a02b48d8fb1c4")
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 1, dtype family float, shape (1000,) 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 cosine_beta_schedule takes timesteps (an integer) and s (a float)
# It uses timesteps as an integer to create a schedule
# s is a hyperparameter with default value 0.008

ARGS = {
    "timesteps": 1000,
    "s": 0.008,
}
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 1, dtype family float, shape (1000,) — shape (1000,) 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
index_to_log_onehot Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
YuzheZhang-1999/DiffTSR/model/TDM/models/diffusion_multinomial.py
code served (permissive licence) · get_code("887b510303aa0cff")
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 4, dtype family float, shape (2, 3, 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Construct a small tensor of indices with batch size 2 and spatial dimensions 4x3
# Values must be less than num_classes
x = torch.tensor([
    [[0, 1, 2, 1], [2, 0, 1, 0], [1, 2, 0, 1]],
    [[1, 0, 2, 0], [0, 1, 2, 1], [2, 1, 0, 2]]
], dtype=torch.long)

num_classes = 3

ARGS = {
    'x': x,
    'num_classes': num_classes
}
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 4, dtype family float, shape (2, 3, 3, 4) — shape (2, 3, 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
inverse Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("7e630357d1081630")
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 3, 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# The function 'inverse' takes two parameters: x and reverse
# x should be a tensor that supports operations like .clamp(), .reciprocal(), and log operations
# reverse is a boolean flag (default False)

# Create a small tensor for x
# When reverse=False, x should be in (0, 1) range since we compute safe_log(x) and safe_log(1-x)
# When reverse=True, x can be any real value since we apply sigmoid
x = torch.tensor([[0.2, 0.5, 0.8, 0.3],
                   [0.4, 0.6, 0.1, 0.9]], dtype=torch.float32)

# reverse parameter
reverse = False

ARGS = {
    "x": x,
    "reverse": reverse
}
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 tuple, ndim 3, 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
log_1_min_a Ran
ran, honoured the contract we drafted
YuzheZhang-1999/DiffTSR/model/TDM/models/diffusion_multinomial.py
code served (permissive licence) · get_code("39226fe0563dc032")
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, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

# The function log_1_min_a takes a single parameter 'a' which is a tensor
# It calls .exp() on it and performs log operations, so 'a' should be a tensor
# The result of a.exp() should be less than 1 for the log argument to be valid
# So 'a' should contain negative values (since exp of negative < 1)

a = torch.randn(2, 4) - 2.0  # Negative values so exp(a) < 1

ARGS = {
    "a": a
}
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, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
log_add_exp Ran
ran, honoured the contract we drafted
YuzheZhang-1999/DiffTSR/model/TDM/models/diffusion_multinomial.py
code served (permissive licence) · get_code("3d24f690340703af")
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, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import math

torch.manual_seed(0)

# Create two small tensors for the log_add_exp function
# The function performs element-wise operations: max, log, exp, subtraction, addition
a = torch.randn(2, 4)
b = torch.randn(2, 4)

ARGS = {
    "a": a,
    "b": b,
}
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, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mixture_inv_cdf Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("cf94102882d34c5a")
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
import torch.nn.functional as F

torch.manual_seed(0)

# Build tiny tensors for the mixture inverse CDF function
batch_size = 2
num_components = 4

# y: uniform random values in (0, 1) for the inverse CDF
y = torch.rand(batch_size) * 0.98 + 0.01  # Keep strictly in (0, 1)

# prior_logits: logits for the mixture components
prior_logits = torch.randn(batch_size, num_components)

# means: means of each logistic component
means = torch.randn(batch_size, num_components)

# log_scales: log scales of each logistic component
log_scales = torch.randn(batch_size, num_components)

ARGS = {
    "y": y,
    "prior_logits": prior_logits,
    "means": means,
    "log_scales": log_scales,
    "eps": 1e-10,
    "max_iters": 100,
}
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
mixture_log_cdf Ran
ran, violated the contract we drafted
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("db244b4a1b9d7755")
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
import torch.nn.functional as F

torch.manual_seed(0)

# Analyze the function signature:
# mixture_log_cdf(x, prior_logits, means, log_scales)
#
# From the function body:
# - x: used with .unsqueeze(dim=-1), and subtracted from means
# - prior_logits: passed to F.log_softmax(prior_logits, dim=-1)
# - means: used in arithmetic with x.unsqueeze(dim=-1)
# - log_scales: used with torch.exp() and in arithmetic
#
# The _log_cdf function is called with:
#   x.unsqueeze(dim=-1), means, log_scales
# So x is unsqueezed to add a dimension, then all three are used element-wise.
#
# This suggests:
# - x: shape (batch_size,) or (batch_size, ...) 
# - prior_logits: shape (num_components,) - used with log_softmax on dim=-1
# - means: shape (num_components,) - must broadcast with x.unsqueeze(dim=-1)
# - log_scales: shape (num_components,) - same as means

batch_size = 2
num_components = 4

x = torch.randn(batch_size)
prior_logits = torch.randn(num_components)
means = torch.randn(num_components)
log_scales = torch.randn(num_components)

ARGS = {
    "x": x,
    "prior_logits": prior_logits,
    "means": means,
    "log_scales": log_scales,
}
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
mixture_log_pdf Ran
ran, honoured the contract we drafted
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("3ae2ea791a983a23")
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, 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Parameters for mixture_log_pdf:
# x: input tensor
# prior_logits: logits for the mixture components
# means: means of the logistic distributions
# log_scales: log scales of the logistic distributions

# Batch size: 2, feature dim: 1 (for x)
# Number of mixture components: 3
batch_size = 2
num_components = 3
feature_dim = 1

# x: shape (batch_size, feature_dim) = (2, 1)
x = torch.randn(batch_size, feature_dim)

# prior_logits: shape (num_components,) - logits for mixture weights
prior_logits = torch.randn(num_components)

# means: shape (num_components,) - one mean per component
means = torch.randn(num_components)

# log_scales: shape (num_components,) - one log_scale per component
log_scales = torch.randn(num_components)

ARGS = {
    "x": x,
    "prior_logits": prior_logits,
    "means": means,
    "log_scales": log_scales,
}
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, 1) — shape (2, 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
run_sequential_with_mask Ran
ran; our contract draft was wrong, not the code
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("3ee1217b23068736")
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 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Build a simple sequential network
class SimpleLayer(nn.Module):
    def __init__(self, in_dim, out_dim):
        super().__init__()
        self.linear = nn.Linear(in_dim, out_dim)
    
    def forward(self, x):
        return self.linear(x)

# Create a sequential network with multiple layers
net = nn.Sequential(
    SimpleLayer(4, 5),
    SimpleLayer(5, 4)
)

# Create input tensor: batch_size=2, sequence_length=3, features=4
x = torch.randn(2, 3, 4)

# Create length tensor
length = torch.tensor([3, 2])

# Create channel padding mask: same shape as x
channel_padding_mask = torch.ones(2, 3, 4)

# Create src_key_padding_mask: shape (batch_size, seq_len)
src_key_padding_mask = torch.zeros(2, 3, dtype=torch.bool)

# Create length_one_hot: one-hot encoding of lengths
length_one_hot = torch.zeros(2, 5)
length_one_hot[0, 3] = 1
length_one_hot[1, 2] = 1

# Create time_embed: temporal embeddings
time_embed = torch.randn(2, 3, 4)

# Create ground truth
gt = torch.randn(2, 3, 4)

# importance_weight is already a scalar
importance_weight = 1.0

# detail_out flag
detail_out = False

ARGS = {
    'net': net,
    'x': x,
    'length': length,
    'channel_padding_mask': channel_padding_mask,
    'src_key_padding_mask': src_key_padding_mask,
    'length_one_hot': length_one_hot,
    'time_embed': time_embed,
    'gt': gt,
    'importance_weight': importance_weight,
    'detail_out': detail_out
}
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 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
safe_log Ran
ran, honoured the contract we drafted
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("13bc23344ef8bd53")
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, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function safe_log takes a single parameter x and applies clamp then log
# x should be a tensor
x = torch.randn(2, 4).abs() + 0.1  # Small positive tensor to avoid log issues

ARGS = {
    "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 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sum_except_batch Ran
ran; our contract draft was wrong, not the code
YuzheZhang-1999/DiffTSR/model/TDM/models/diffusion_multinomial.py
code served (permissive licence) · get_code("38d8ef27c0f4b98a")
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)

# Create a small tensor with batch dimension
# Shape: (batch_size=2, dim1=4, dim2=3) - 3D tensor
x = torch.randn(2, 4, 3)

# num_dims specifies how many leading dimensions to keep
# Default is 1 (just the batch dimension)
num_dims = 1

ARGS = {
    "x": x,
    "num_dims": num_dims,
}
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
CouplingLayer Not yet run
unverified (harvested, no recorded run)
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("62906ae69863334e")
How it ran

no invocation recorded.

DiffusionWrapper Not yet run
unverified (harvested, no recorded run)
YuzheZhang-1999/DiffTSR/model/TDM/models/diffusion_multinomial.py
code served (permissive licence) · get_code("a15ee5030a6486ce")
How it ran

no invocation recorded.

DiscreteAutoregressiveFlow Not yet run
unverified (harvested, no recorded run)
TrentBrick/PyTorchDiscreteFlows/discrete_flows/disc_models.py
pointer only (licence: NONE) · get_code("b2a81908ae5a22a5")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, TrentBrick/PyTorchDiscreteFlows when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

FlowLayer Not yet run
unverified (harvested, no recorded run)
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("0fd897703533ac05")
How it ran

no invocation recorded.

MixtureCDFCoupling Not yet run
unverified (harvested, no recorded run)
didriknielsen/argmax_flows/model/CategoricalNF/flows/mixture_cdf_layer.py
code served (permissive licence) · get_code("790a25da85a326bc")
How it ran

no invocation recorded.

MultinomialDiffusion Not yet run
unverified (harvested, no recorded run)
YuzheZhang-1999/DiffTSR/model/TDM/models/diffusion_multinomial.py
code served (permissive licence) · get_code("08aec1a58f72176a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 20 samples lifted from this paper's linked repositories, 20 carry a function identity and 0 do not. Of the 20 distinct functions with an identity, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 later) and 14 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
log_add_exp
brick of this paper's assembly: helper
14 other papers
14 later · 3 only as an assembly brick
Gu_Vector_Quantized_Diffusion_Model_for_Text-to-Image_Synthesis_CVPR_2022_paper (2022 (year only))
Vector Quantized Diffusion Model for Text-to-Image Synthesis
2205.16007 (2022-05)
Improved Vector Quantized Diffusion Models
2206.07771 (2022-06)
Discrete Contrastive Diffusion for Cross-Modal Music and Image Generation
and 11 more not named here
log_1_min_a
brick of this paper's assembly: helper
13 other papers
13 later · 3 only as an assembly brick
Gu_Vector_Quantized_Diffusion_Model_for_Text-to-Image_Synthesis_CVPR_2022_paper (2022 (year only))
Vector Quantized Diffusion Model for Text-to-Image Synthesis
2205.16007 (2022-05)
Improved Vector Quantized Diffusion Models
2206.07771 (2022-06)
Discrete Contrastive Diffusion for Cross-Modal Music and Image Generation
and 10 more not named here
cosine_beta_schedule
brick of this paper's assembly: scheduler
11 other papers
11 later · 1 only as an assembly brick
2303.03543 (2023-03)
3D Equivariant Diffusion for Target-Aware Molecule Generation and Affinity Prediction
2310.17800 (2023-10)
Interacting Diffusion Processes for Event Sequence Forecasting
2402.18583 (2024-02)
Binding-Adaptive Diffusion Models for Structure-Based Drug Design
and 8 more not named here
sum_except_batch
brick of this paper's assembly: helper
9 other papers
9 later · 2 only as an assembly brick
Gu_Vector_Quantized_Diffusion_Model_for_Text-to-Image_Synthesis_CVPR_2022_paper (2022 (year only))
Vector Quantized Diffusion Model for Text-to-Image Synthesis
2205.16007 (2022-05)
Improved Vector Quantized Diffusion Models
2206.07771 (2022-06)
Discrete Contrastive Diffusion for Cross-Modal Music and Image Generation
and 6 more not named here
index_to_log_onehot
brick of this paper's assembly: data_transform
2 other papers
2 later · 1 only as an assembly brick
2206.07771 (2022-06)
Discrete Contrastive Diffusion for Cross-Modal Music and Image Generation
2303.11589 (2023-03)
LayoutDiffusion: Improving Graphic Layout Generation by Discrete Diffusion Probabilistic Models
safe_log
brick of this paper's assembly: helper
1 other paper
1 later
2210.00999 (2022-10)
Latent State Marginalization as a Low-cost Approach for Improving Exploration

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

Generative flows and diffusion models have been predominantly trained on ordinal data, for example natural images. This paper introduces two extensions of flows and diffusion for categorical data such as language or image segmentation: Argmax Flows and Multinomial Diffusion. Argmax Flows are defined by a composition of a continuous distribution (such as a normalizing flow), and an argmax function. To optimize this model, we learn a probabilistic inverse for the argmax that lifts the categorical data to a continuous space. Multinomial Diffusion gradually adds categorical noise in a diffusion process, for which the generative denoising process is learned. We demonstrate that our method outperforms existing dequantization approaches on text modelling and modelling on image segmentation maps in log-likelihood.

For agents

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

get_harvested_code_for_paper("2102.05379")
get_code_for_paper("2102.05379")
have("2102.05379")

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

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

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

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

Connect an agent — have() is free.