SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.09790 · ICLR · 2021

Categorical Normalizing Flows via Continuous Transformations

Phillip Lippe, Efstratios Gavves

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-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/2006.09790.json · badge: /api/ran/2006.09790.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
phlippe/CategoricalNF canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
add_scheduler_parameters Ran
ran on a synthesized input
phlippe/CategoricalNF/general/parameter_scheduler.py
code served (permissive licence) · get_code("24db3da051806583")
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 ArgumentParser. 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 argparse

ARGS = {
    'parser': argparse.ArgumentParser(),
    'param_names': ['learning_rate', 'weight_decay'],
    'default_vals': {
        'learning_rate': ('sigmoid', 0.001, 0.1, 50, 1.5, 10),
        'weight_decay': ('exponential', 0.0001, 0.01, 200, 2.5, 5)
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
create_embed_layer Ran
ran on a synthesized input
phlippe/CategoricalNF/layers/categorical_encoding/decoder.py
code served (permissive licence) · get_code("b8b3ef597042e614")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a mock vocab object with vectors
class MockVocab:
    def __init__(self, vectors):
        self.vectors = vectors
    
    def __len__(self):
        return self.vectors.shape[0]

# Case 1: vocab with vectors
vocab_vectors = torch.randn(10, 8)  # 10 vocab items, 8-dim embeddings
vocab_with_vectors = MockVocab(vocab_vectors)

# Case 2: vocab without vectors (None)
vocab_no_vectors = None

# Setup for the function call - using vocab with vectors
ARGS = {
    "vocab": vocab_with_vectors,
    "vocab_size": 5000,  # This will be overridden since vocab is not None
    "default_embed_layer_dims": 16  # This will be overridden since vocab has vectors
}
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 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
load_args Ran
ran on a synthesized input
phlippe/CategoricalNF/general/mutils.py
code served (permissive licence) · get_code("54d6f181d75d8a50")
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 pickle
import tempfile
import shutil

# Create a temporary directory to act as checkpoint_path
temp_dir = tempfile.mkdtemp()

# Create a sample args object (can be any picklable object)
sample_args = {
    'learning_rate': 0.001,
    'batch_size': 32,
    'epochs': 10,
    'model_name': 'test_model'
}

# Save the args to the param_config.pik file in the temp directory
param_config_path = os.path.join(temp_dir, 'param_config.pik')
with open(param_config_path, 'wb') as f:
    pickle.dump(sample_args, f)

# Define checkpoint_path - can be either the directory or a file path within it
checkpoint_path = temp_dir

ARGS = {
    'checkpoint_path': checkpoint_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
logdist Ran
ran on a synthesized input
phlippe/CategoricalNF/images/visu_file.py
code served (permissive licence) · get_code("df4b531564aed649")
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 (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function takes:
# - x: array-like input points
# - mu: mean (scalar, default 0)
# - sigma: standard deviation (scalar, default 1.0)

# Create a small numpy array for x
x = np.array([-2.0, -1.0, 0.0, 1.0, 2.0])

# Define scalar parameters
mu = 0.5
sigma = 1.5

ARGS = {
    "x": x,
    "mu": mu,
    "sigma": sigma
}
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 (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
scheduler_args_to_params Ran
ran on a synthesized input
phlippe/CategoricalNF/general/parameter_scheduler.py
code served (permissive licence) · get_code("4f77250b95215cae")
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 torch
import argparse

torch.manual_seed(0)

# Create a mock args object with the required attributes
# The function looks for attributes of the form: {name}_{p}
# where name comes from param_names and p in ['scheduler_type', 'scheduler_end_val', 
# 'scheduler_start_val', 'scheduler_step_size', 'scheduler_logit', 'scheduler_delay']

args = argparse.Namespace()

# For param_names = ['lr', 'momentum']
# We need: lr_scheduler_type, lr_scheduler_end_val, lr_scheduler_start_val, 
#          lr_scheduler_step_size, lr_scheduler_logit, lr_scheduler_delay
#          momentum_scheduler_type, momentum_scheduler_end_val, etc.

# Setting up for 'lr' parameter
args.lr_scheduler_type = 'exponential'
args.lr_scheduler_end_val = 0.0001
args.lr_scheduler_start_val = 0.1
args.lr_scheduler_step_size = 100
args.lr_scheduler_logit = False
args.lr_scheduler_delay = 0

# Setting up for 'momentum' parameter
args.momentum_scheduler_type = 'linear'
args.momentum_scheduler_end_val = 0.99
args.momentum_scheduler_start_val = 0.9
args.momentum_scheduler_step_size = 50
args.momentum_scheduler_logit = True
args.momentum_scheduler_delay = 5

# Setting up for 'weight_decay' parameter
args.weight_decay_scheduler_type = 'constant'
args.weight_decay_scheduler_end_val = 1e-5
args.weight_decay_scheduler_start_val = 1e-5
args.weight_decay_scheduler_step_size = 1
args.weight_decay_scheduler_logit = False
args.weight_decay_scheduler_delay = 0

param_names = ['lr', 'momentum', 'weight_decay']

ARGS = {
    'args': args,
    'param_names': param_names
}
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 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
sort_to_line Ran
ran on a synthesized input
phlippe/CategoricalNF/images/visu_file.py
code served (permissive licence) · get_code("2d43a7be1bdc1405")
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 (5, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a simple numpy array of 2D points (border points)
# The function expects an array where each row is a point with coordinates
vals = np.array([
    [0.0, 0.0],
    [1.0, 1.0],
    [2.0, 0.5],
    [1.5, 2.0],
    [0.5, 1.5]
], dtype=np.float32)

ARGS = {
    "vals": vals
}
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 (5, 2) — shape (5, 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
load_model Not yet run
unverified (harvested, no recorded run)
phlippe/CategoricalNF/general/mutils.py
code served (permissive licence) · get_code("14bdea82d68b6932")
How it ran

no invocation recorded.

load_model_from_args Not yet run
unverified (harvested, no recorded run)
phlippe/CategoricalNF/general/mutils.py
code served (permissive licence) · get_code("42627605b244e295")
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-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

Despite their popularity, to date, the application of normalizing flows on categorical data stays limited. The current practice of using dequantization to map discrete data to a continuous space is inapplicable as categorical data has no intrinsic order. Instead, categorical data have complex and latent relations that must be inferred, like the synonymy between words. In this paper, we investigate Categorical Normalizing Flows, that is normalizing flows for categorical data. By casting the encoding of categorical data in continuous space as a variational inference problem, we jointly optimize the continuous representation and the model likelihood. Using a factorized decoder, we introduce an inductive bias to model any interactions in the normalizing flow. As a consequence, we do not only simplify the optimization compared to having a joint decoder, but also make it possible to scale up to a large number of categories that is currently impossible with discrete normalizing flows. Based on Categorical Normalizing Flows, we propose GraphCNF a permutationinvariant generative model on graphs. GraphCNF implements a three-step approach modeling the nodes, edges, and adjacency matrix stepwise to increase efficiency. On molecule generation, GraphCNF outperforms both one-shot and autoregressive flow-based state-of-the-art.

For agents

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

get_harvested_code_for_paper("2006.09790")
get_code_for_paper("2006.09790")
have("2006.09790")

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

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

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

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

Connect an agent — have() is free.