SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.02164 · ICML · 2023

Nonparametric Generative Modeling with Conditional Sliced-Wasserstein Flows

Tianyu Pang, Min Lin, Shuicheng Yan, Chao Du, Tianbo Li

arXiv · PDF · Open in the Atlas

Code that ran

8 of 14 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, 2 violated it and 1 has no contract verdict; 5 failures of our instrument; 6 no recorded run), measured 2026-11-23; 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/2305.02164.json · badge: /api/ran/2305.02164.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
duchao0726/conditional-swf canonical (classifier label)
classifier basis: classifier_2025
6 ran · 2 no recorded run
duchao0726/conditionial-swf canonical (classifier label)
classifier basis: census
2 ran · 4 no recorded run
FunctionStatusWhere it lives
downsample_slicer Ran
ran on a synthesized input
duchao0726/conditionial-swf/slicers.py
code served (permissive licence) · get_code("3cd11ee82400cde6")
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 ArrayImpl, ndim 2, dtype family float, shape (2, 60) 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 jax
import jax.numpy as jnp
import numpy as np

def slice_fn(key, dim, input_shape, **kwargs):
    """Stand-in slice function that returns weights of shape (out_features, dim)"""
    out_features = 2
    return jnp.ones((out_features, dim))

key = jax.random.PRNGKey(0)
input_shape = (3, 4, 5)
down_size = (2, 3)

ARGS = {
    'key': key,
    'slice_fn': slice_fn,
    'input_shape': input_shape,
    'down_size': down_size,
    'method': 'lanczos3'
}
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 ArrayImpl, ndim 2, dtype family float, shape (2, 60) — shape (2, 60) 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
rq_spline_compute_shared Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
duchao0726/conditional-swf/models.py
code served (permissive licence) · get_code("a9d91d1a963d845d")
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 2, 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.numpy as jnp
import numpy as np

# Construct small valid arguments for rq_spline_compute_shared
bin_widths = jnp.array([0.2, 0.3, 0.25, 0.25])
bin_heights = jnp.array([0.15, 0.35, 0.3, 0.2])
knot_slopes = jnp.array([1.0, 1.2, 0.9, 1.1])
x_or_y = jnp.array([0.3, 0.7])
range_min = 0.0
is_x = True

ARGS = {
    "bin_widths": bin_widths,
    "bin_heights": bin_heights,
    "knot_slopes": knot_slopes,
    "x_or_y": x_or_y,
    "range_min": range_min,
    "is_x": is_x,
}
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, ndim 2, 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
rq_spline_forward Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
duchao0726/conditional-swf/models.py
code served (permissive licence) · get_code("ee73a29e783f7406")
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 ArrayImpl, 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 jax.numpy as jnp

# Create tiny test data for the rational quadratic spline function
# The function expects 1D arrays for bin_widths, bin_heights, knot_slopes
# and a 1D array for x values

# Number of bins/knots
n_bins = 4

# bin_widths: 1D array of bin widths, should sum to span the range
bin_widths = jnp.array([0.25, 0.25, 0.25, 0.25], dtype=jnp.float32)

# bin_heights: 1D array of bin heights, should sum to span the range
bin_heights = jnp.array([0.2, 0.3, 0.25, 0.25], dtype=jnp.float32)

# knot_slopes: 1D array of slopes at interior knots (length n_bins - 1)
knot_slopes = jnp.array([1.0, 1.2, 0.9], dtype=jnp.float32)

# x: input values for forward transformation (1D array with batch size 2)
x = jnp.array([0.3, 0.7], dtype=jnp.float32)

# range_min: minimum value of the valid range
range_min = 0.0

ARGS = {
    "bin_widths": bin_widths,
    "bin_heights": bin_heights,
    "knot_slopes": knot_slopes,
    "x": x,
    "range_min": range_min,
}
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 ArrayImpl, 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
rq_spline_inverse Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
duchao0726/conditional-swf/models.py
code served (permissive licence) · get_code("1817a12593769a54")
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 ArrayImpl, 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 jax.numpy as jnp
import numpy as np

# Create small test tensors for the rational quadratic spline inverse
# The function expects 1D arrays for bin_widths, bin_heights, knot_slopes
# and a scalar or array for y

bin_widths = jnp.array([0.2, 0.3, 0.25, 0.25], dtype=jnp.float32)
bin_heights = jnp.array([0.15, 0.35, 0.3, 0.2], dtype=jnp.float32)
knot_slopes = jnp.array([1.0, 0.9, 1.1, 0.95], dtype=jnp.float32)

# Create y values that should be within bounds
# range_min is 0.0, so ky will be cumsum of bin_heights starting from 0.0
# ky = [0.0, 0.15, 0.5, 0.8, 1.0]
y = jnp.array([0.3, 0.7], dtype=jnp.float32)

range_min = 0.0

ARGS = {
    "bin_widths": bin_widths,
    "bin_heights": bin_heights,
    "knot_slopes": knot_slopes,
    "y": y,
    "range_min": range_min,
}
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 ArrayImpl, 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
sorting_forward Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
duchao0726/conditional-swf/models.py
code served (permissive licence) · get_code("f51569c65cf2c489")
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 ArrayImpl, ndim 0, dtype family float, 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 jax.numpy as jnp
import numpy as np

# Create small JAX arrays for the sorting_forward function
# xs: sorted array of values to search within
# x: query value(s) to search for

xs = jnp.array([1.0, 3.0, 5.0, 7.0])  # sorted reference points
x = jnp.array(4.0)  # query value to search for

ARGS = {
    "xs": xs,
    "x": x,
}
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 ArrayImpl, ndim 0, dtype family float, 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
sorting_inverse Ran
ran, violated the contract we drafted
duchao0726/conditional-swf/models.py
code served (permissive licence) · get_code("b4d8bed5456892c3")
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 ArrayImpl, ndim 1, dtype family float, shape (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 jax.numpy as jnp
import numpy as np

# Construct arguments for sorting_inverse function
# ys: array of sorted values, shape (ny,)
# cdf: cumulative distribution function values, shape (n_cdf,), values in [0, 1]

ny = 5
n_cdf = 3

# Create ys as a sorted array of values
ys = jnp.array([1.0, 2.5, 4.0, 5.5, 7.0], dtype=jnp.float32)

# Create cdf as values between 0 and 1
cdf = jnp.array([0.1, 0.5, 0.9], dtype=jnp.float32)

ARGS = {
    "ys": ys,
    "cdf": cdf,
}
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 ArrayImpl, ndim 1, dtype family float, shape (3,) — shape (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
str2bool Ran
ran, violated the contract we drafted
duchao0726/conditionial-swf/utils.py
code served (permissive licence) · get_code("4641809ecfcb7b7b")
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 bool, ndim 0, dtype family float, 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)

ARGS = {
    'v': 'true'
}
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 bool, ndim 0, dtype family float, 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
uniform Ran
ran; our contract draft was wrong, not the code
duchao0726/conditional-swf/models.py
code served (permissive licence) · get_code("986a8dd38cbe6fef")
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 ArrayImpl, ndim 2, dtype family float, shape (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 jax
import jax.numpy as jnp

# Set seed for reproducibility
key = jax.random.PRNGKey(0)

# The function parameters are: key, dim, hdim, **kwargs
# - key: a JAX random key
# - dim: dimension of the weight matrix (second dimension)
# - hdim: hidden dimension (first dimension)
# - **kwargs: optional keyword arguments (not used in the function body)

ARGS = {
    "key": jax.random.PRNGKey(0),
    "dim": 4,
    "hdim": 3,
}
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 ArrayImpl, ndim 2, dtype family float, shape (3, 4) — shape (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
cifar10 Not yet run
unverified (harvested, no recorded run)
duchao0726/conditionial-swf/dataset.py
code served (permissive licence) · get_code("e4d5a86db39f65e7")
How it ran

no invocation recorded.

conv Not yet run
unverified (harvested, no recorded run)
duchao0726/conditionial-swf/slicers.py
code served (permissive licence) · get_code("620bf56cd200bbad")
How it ran

no invocation recorded.

find_neighbors Not yet run
unverified (harvested, no recorded run)
duchao0726/conditionial-swf/utils.py
code served (permissive licence) · get_code("4ab768bcd868e490")
How it ran

no invocation recorded.

get_dataset Not yet run
unverified (harvested, no recorded run)
duchao0726/conditionial-swf/dataset.py
code served (permissive licence) · get_code("cb0a360ad67bc30e")
How it ran

no invocation recorded.

layer Not yet run
unverified (harvested, no recorded run)
duchao0726/conditional-swf/models.py
code served (permissive licence) · get_code("e316ded1bfbdf90c")
How it ran

no invocation recorded.

swf_model Not yet run
unverified (harvested, no recorded run)
duchao0726/conditional-swf/models.py
code served (permissive licence) · get_code("9500f7707928a3b2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 13 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
str2bool 5 other papers
3 dated earlier, 2 later
2010.16262 (2020-10)
Experimental design for MRI by greedy policy search
2201.06648 (2022-01)
OmniPrint: A Configurable Printed Character Synthesizer
2207.12020 (2022-07)
Domain-invariant Feature Exploration for Domain Generalization
and 2 more not named here

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-23.

Repositories linked to this paper

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

Abstract

Sliced-Wasserstein Flow (SWF) is a promising approach to nonparametric generative modeling but has not been widely adopted due to its suboptimal generative quality and lack of conditional modeling capabilities. In this work, we make two major contributions to bridging this gap. First, based on a pleasant observation that (under certain conditions) the SWF of joint distributions coincides with those of conditional distributions, we propose Conditional Sliced-Wasserstein Flow (CSWF), a simple yet effective extension of SWF that enables nonparametric conditional modeling. Second, we introduce appropriate inductive biases of images into SWF with two techniques inspired by local connectivity and multiscale representation in vision research, which greatly improve the efficiency and quality of modeling images. With all the improvements, we achieve generative performance comparable with many deep parametric generative models on both conditional and unconditional tasks in a purely nonparametric fashion, demonstrating its great potential.

For agents

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

get_harvested_code_for_paper("2305.02164")
get_code_for_paper("2305.02164")
have("2305.02164")

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

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

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

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

Connect an agent — have() is free.