SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.23170 · NeurIPS · 2024

Functional Gradient Flows for Constrained Sampling

Cheng Zhang, Shiyue Zhang, Longlin Yu, Ziheng Cheng

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 6 failures of our instrument; 2 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/2410.23170.json · badge: /api/ran/2410.23170.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
ShiyueZhang66/Constrained-Functional-Gradient-Flow marked official in Papers with Code
Papers with Code archive
7 ran · 2 no recorded run
Extraltodeus/Skimmed_CFG extension (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
BNNClassifier Ran
ran on a synthesized input · constructed an object; no result was computed
ShiyueZhang66/Constrained-Functional-Gradient-Flow/Monotonic BNN/CFG_bnn/runners.py
pointer only (licence: NONE) · get_code("12fbdc03d5e1e46f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ShiyueZhang66/Constrained-Functional-Gradient-Flow 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.

F_net Ran
ran on a synthesized input · constructed an object; no result was computed
ShiyueZhang66/Constrained-Functional-Gradient-Flow/Monotonic BNN/CFG_bnn/runners.py
pointer only (licence: NONE) · get_code("ff0707ff82829c52")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ShiyueZhang66/Constrained-Functional-Gradient-Flow 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.

Z_net Ran
ran on a synthesized input · constructed an object; no result was computed
ShiyueZhang66/Constrained-Functional-Gradient-Flow/Monotonic BNN/CFG_bnn/runners.py
pointer only (licence: NONE) · get_code("3f24bf5f55d8ce60")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ShiyueZhang66/Constrained-Functional-Gradient-Flow 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.

generate_normalize_numerical_mat Ran
ran, honoured the contract we drafted
ShiyueZhang66/Constrained-Functional-Gradient-Flow/Monotonic BNN/CFG_bnn/runners.py
pointer only (licence: NONE) · get_code("d451d2d77a159994")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ShiyueZhang66/Constrained-Functional-Gradient-Flow 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.

generate_one_hot_mat Ran
ran; our contract draft was wrong, not the code
ShiyueZhang66/Constrained-Functional-Gradient-Flow/Monotonic BNN/CFG_bnn/runners.py
pointer only (licence: NONE) · get_code("8579b1f0c4075070")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ShiyueZhang66/Constrained-Functional-Gradient-Flow 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.

get_skimming_mask Ran
ran; our contract draft was wrong, not the code
Extraltodeus/Skimmed_CFG/skimmed_CFG.py
code served (permissive licence) · get_code("b7525eaf099c0049")
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) 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)

# Create small tensors with distinct dimensions for clarity
# batch_size=2, feature_dim=4
x_orig = torch.randn(2, 4)
cond = torch.randn(2, 4)
uncond = torch.randn(2, 4)
cond_scale = 7.5

ARGS = {
    "x_orig": x_orig,
    "cond": cond,
    "uncond": uncond,
    "cond_scale": cond_scale,
    "return_denoised": False,
    "disable_flipping_filter": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
interpolated_scales Ran
ran; our contract draft was wrong, not the code
Extraltodeus/Skimmed_CFG/skimmed_CFG.py
code served (permissive licence) · get_code("0f0e888ded533663")
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) 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)

# Create small tensors with distinct dimensions
batch_size = 2
dim = 4

x_orig = torch.randn(batch_size, dim)
cond = torch.randn(batch_size, dim)
uncond = torch.randn(batch_size, dim)
cond_scale = 7.5
small_scale = 1.5
squared = False
root_dist = False

ARGS = {
    "x_orig": x_orig,
    "cond": cond,
    "uncond": uncond,
    "cond_scale": cond_scale,
    "small_scale": small_scale,
    "squared": squared,
    "root_dist": root_dist,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
load_data Ran
ran; our contract draft was wrong, not the code
ShiyueZhang66/Constrained-Functional-Gradient-Flow/Monotonic BNN/CFG_bnn/runners.py
pointer only (licence: NONE) · get_code("a97ff05389d00e15")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ShiyueZhang66/Constrained-Functional-Gradient-Flow 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.

normalize_data_ours Ran
ran; our contract draft was wrong, not the code
ShiyueZhang66/Constrained-Functional-Gradient-Flow/Monotonic BNN/CFG_bnn/runners.py
pointer only (licence: NONE) · get_code("7e1954f30c7a9e83")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ShiyueZhang66/Constrained-Functional-Gradient-Flow 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.

skimmed_CFG Ran
ran; our contract draft was wrong, not the code
Extraltodeus/Skimmed_CFG/skimmed_CFG.py
code served (permissive licence) · get_code("97625a658e3fa3aa")
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) 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)

# Create small tensors for the function arguments
# The function performs element-wise operations on tensors, so we need:
# - x_orig: original tensor
# - cond: conditioned tensor
# - uncond: unconditioned tensor
# - cond_scale: scalar for scaling
# - skimming_scale: scalar for skimming

batch_size = 2
dim = 4

x_orig = torch.randn(batch_size, dim)
cond = torch.randn(batch_size, dim)
uncond = torch.randn(batch_size, dim)
cond_scale = 7.5
skimming_scale = 5.0
disable_flipping_filter = False

ARGS = {
    "x_orig": x_orig,
    "cond": cond,
    "uncond": uncond,
    "cond_scale": cond_scale,
    "skimming_scale": skimming_scale,
    "disable_flipping_filter": disable_flipping_filter,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
ConstrainedGWG Not yet run
unverified (harvested, no recorded run)
ShiyueZhang66/Constrained-Functional-Gradient-Flow/Monotonic BNN/CFG_bnn/runners.py
pointer only (licence: NONE) · get_code("953cf1ae00d88ff9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ShiyueZhang66/Constrained-Functional-Gradient-Flow 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.

RUNNER Not yet run
unverified (harvested, no recorded run)
ShiyueZhang66/Constrained-Functional-Gradient-Flow/Monotonic BNN/CFG_bnn/runners.py
pointer only (licence: NONE) · get_code("ff25ad1c88331c77")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ShiyueZhang66/Constrained-Functional-Gradient-Flow 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.

Also present in other papers' code

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

Recently, through a unified gradient flow perspective of Markov chain Monte Carlo (MCMC) and variational inference (VI), particle-based variational inference methods (ParVIs) have been proposed that tend to combine the best of both worlds. While typical ParVIs such as Stein Variational Gradient Descent (SVGD) approximate the gradient flow within a reproducing kernel Hilbert space (RKHS), many attempts have been made recently to replace RKHS with more expressive function spaces, such as neural networks. While successful, these methods are mainly designed for sampling from unconstrained domains. In this paper, we offer a general solution to constrained sampling by introducing a boundary condition for the gradient flow which would confine the particles within the specific domain. This allows us to propose a new functional gradient ParVI method for constrained sampling, called constrained functional gradient flow (CFG), with provable continuous-time convergence in total variation (TV). We also present novel numerical strategies to handle the boundary integral term arising from the domain constraints. Our theory and experiments demonstrate the effectiveness of the proposed framework.

For agents

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

get_harvested_code_for_paper("2410.23170")
get_code_for_paper("2410.23170")
have("2410.23170")

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

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

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

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

Connect an agent — have() is free.