SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2304.06094 · 2023

Energy-guided Entropic Neural Optimal Transport

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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 8 have no contract verdict; 0 failures of our instrument; 3 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/2304.06094.json · badge: /api/ran/2304.06094.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
petrmokrov/energy-guided-entropic-ot canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
batch_jacobian Ran
ran on a synthesized input
petrmokrov/energy-guided-entropic-ot/src/utils.py
code served (permissive licence) · get_code("e6d9dfda0f695bd3")
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, 4, 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.autograd as autograd

torch.manual_seed(0)

# Create a simple function that maps R^N -> R^N
# We need x to require grad and y to be a function of x
B, N = 2, 4

# Create input x with requires_grad=True
x = torch.randn(B, N, requires_grad=True)

# Create output y as a function of x
# Simple function: y = x^2 + 2*x
y = x ** 2 + 2 * x

ARGS = {
    'x': x,
    'y': y,
    'create_graph': True,
    'retain_graph': 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 Tensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 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
clip_by_norm Ran
ran on a synthesized input
petrmokrov/energy-guided-entropic-ot/src/eot.py
code served (permissive licence) · get_code("b341005633913916")
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)

# Create a 2D tensor with batch size 2 and feature dimension 4
x = torch.randn(2, 4)

# Set norm threshold
norm_thresh = 0.5

ARGS = {
    "x": x,
    "norm_thresh": norm_thresh,
}
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
conditional_sample_from_EgEOT Ran
ran on a synthesized input
petrmokrov/energy-guided-entropic-ot/src/eot_utils.py
code served (permissive licence) · get_code("eacdb4c52360ccae")
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 (6, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal config class with all required attributes
class Config:
    def __init__(self):
        self.PIX_VAL_MIN = 0.0
        self.PIX_VAL_MAX = 1.0
        self.ENERGY_SAMPLING_ITERATIONS = 2
        self.ENERGY_SAMPLING_STEP = 0.1
        self.LANGEVIN_DECAY = 0.99
        self.TEST_ENERGY_SAMPLING_ITERATIONS = 1
        self.TEST_ENERGY_SAMPLING_STEP = 0.05
        self.TEST_LANGEVIN_DECAY = 0.95

# Build a minimal noise generator
class NoiseGen:
    def sample(self, shape):
        return torch.randn(shape)

# Build a minimal sample buffer
class SampleBuffer:
    def __init__(self):
        self.noise_gen = NoiseGen()

# Build a minimal model
class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.sample_buffer = SampleBuffer()
    
    def sample(self, X, n_iterations, step_size, decay, y_init):
        # X shape: (batch_size, 4)
        # y_init shape: (batch_size, 3)
        # Return tensor of same shape as y_init
        batch_size = X.size(0)
        return torch.randn(batch_size, 3)

# Create instances
config = Config()
model = DummyModel()

# X: (2, 4) - batch of 2 samples with feature dim 4
X = torch.randn(2, 4)

# y_per_x: number of samples per X
y_per_x = 3

# Y_init: optional initialization (None to use model's noise_gen)
Y_init = None

# train_mode: whether in training mode
train_mode = False

# batch_size: batch size for processing
batch_size = 4

# to_cpu: whether to move results to CPU
to_cpu = True

# images_flag: whether inputs are images
images_flag = True

ARGS = {
    'model': model,
    'config': config,
    'X': X,
    'y_per_x': y_per_x,
    'Y_init': Y_init,
    'train_mode': train_mode,
    'batch_size': batch_size,
    'to_cpu': to_cpu,
    'images_flag': images_flag,
}
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 (6, 3) — shape (6, 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
l2sq_cost Ran
ran on a synthesized input
petrmokrov/energy-guided-entropic-ot/mnist2to3/eval_ot.py
code served (permissive licence) · get_code("b0bf915554f16952")
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 l2sq_cost takes two tensors x and y
# It asserts they have the same shape
# It reshapes them to (batch_size, -1) and computes L2 squared distance
# Returns a tensor of shape (batch_size,)

# Create two tensors with matching shapes
# batch_size=2, and some feature dimensions (3, 4) to show distinct sizes
x = torch.randn(2, 3, 4)
y = torch.randn(2, 3, 4)

ARGS = {
    'x': x,
    'y': y
}
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
load_pickle Ran
ran on a synthesized input
petrmokrov/energy-guided-entropic-ot/dgm_utils/data.py
code served (permissive licence) · get_code("b7849c0935ad7b2f")
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 5, 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 numpy as np
import pickle
import tempfile
import os

# Create a temporary pickle file with the expected data structure
temp_dir = tempfile.mkdtemp()
pickle_path = os.path.join(temp_dir, 'test_data.pkl')

# Create mock data with shape (batch, height, width, channels)
# Using small dimensions: batch=2, height=4, width=3, channels=2
train_array = np.random.randint(0, 256, size=(2, 4, 3, 2), dtype=np.uint8)
test_array = np.random.randint(0, 256, size=(2, 4, 3, 2), dtype=np.uint8)

data_dict = {
    'train': train_array,
    'test': test_array
}

with open(pickle_path, 'wb') as f:
    pickle.dump(data_dict, f)

ARGS = {
    'path': pickle_path,
    'flatten': False,
    'binarize': False
}
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 tuple, ndim 5, 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
make_numpy Ran
ran on a synthesized input
petrmokrov/energy-guided-entropic-ot/src/utils.py
code served (permissive licence) · get_code("492fe520b3bbc0ec")
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 (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 numpy as np

torch.manual_seed(0)

# Test case 1: torch.Tensor input
tensor_input = torch.randn(2, 4)

# Test case 2: numpy.ndarray input
numpy_input = np.random.randn(3, 5)

# Test case 3: list input
list_input = [1, 2, 3, 4]

# The function takes a single parameter X that can be:
# - torch.Tensor (will detach, move to cpu, convert to numpy)
# - np.ndarray (will return as-is)
# - other (will convert via np.asarray)

ARGS = {
    "X": tensor_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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 (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
sample_langevin_batch Ran
ran on a synthesized input
petrmokrov/energy-guided-entropic-ot/src/eot.py
code served (permissive licence) · get_code("5e8bf2ee50178f10")
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 numpy as np
import torch.nn as nn

torch.manual_seed(0)

class SimpleScoreFunction(nn.Module):
    """Minimal score function that returns (score, cost_part, score_part)"""
    def __init__(self, input_size):
        super().__init__()
        self.linear = nn.Linear(input_size, input_size)
    
    def forward(self, x, ret_stats=False):
        score = self.linear(x)
        if ret_stats:
            cost_part = score * 0.5
            score_part = score * 0.3
            return score, cost_part, score_part
        return score

# Create minimal test data
batch_size = 2
input_dim = 4

score_fn = SimpleScoreFunction(input_dim)

# Create input tensor (batch_size, input_dim)
x = torch.randn(batch_size, input_dim)

# Define data projector that clamps values
data_projector = lambda x: x.clamp_(0.0, 1.0)

ARGS = {
    "score_function": score_fn,
    "x": x,
    "eps": 0.001,
    "n_steps": 5,
    "decay": 0.99,
    "thresh": None,
    "noise": 0.005,
    "data_projector": data_projector,
    "compute_stats": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
spectral_norm Ran
ran on a synthesized input
petrmokrov/energy-guided-entropic-ot/src/models_utils.py
code served (permissive licence) · get_code("1bded705b21cb40a")
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 Linear. 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)

# Create a simple module with a weight parameter
module = nn.Linear(4, 3, bias=True)

# Define the arguments dictionary
ARGS = {
    'module': module,
    'init': True,
    'zero_bias': True,
    'std': 1,
    'bound': False,
    'n_iters': 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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
sample_image_set Not yet run
unverified (harvested, no recorded run)
petrmokrov/energy-guided-entropic-ot/mnist2to3/eval_ot.py
code served (permissive licence) · get_code("9b5f33316d34439f")
How it ran

no invocation recorded.

sample_pseudo_langevin_batch Not yet run
unverified (harvested, no recorded run)
petrmokrov/energy-guided-entropic-ot/src/eot.py
code served (permissive licence) · get_code("3459932850a115b9")
How it ran

no invocation recorded.

visualize_2d_contour Not yet run
unverified (harvested, no recorded run)
petrmokrov/energy-guided-entropic-ot/dgm_utils/visualize.py
code served (permissive licence) · get_code("a48d15fe86871566")
How it ran

no invocation recorded.

Also present in other papers' code

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

Energy-based models (EBMs) are known in the Machine Learning community for decades. Since the seminal works devoted to EBMs dating back to the noughties, there have been a lot of efficient methods which solve the generative modelling problem by means of energy potentials (unnormalized likelihood functions). In contrast, the realm of Optimal Transport (OT) and, in particular, neural OT solvers is much less explored and limited by few recent works (excluding WGAN-based approaches which utilize OT as a loss function and do not model OT maps themselves). In our work, we bridge the gap between EBMs and Entropy-regularized OT. We present a novel methodology which allows utilizing the recent developments and technical improvements of the former in order to enrich the latter. From the theoretical perspective, we prove generalization bounds for our technique. In practice, we validate its applicability in toy 2D and image domains. To showcase the scalability, we empower our method with a pre-trained StyleGAN and apply it to high-res AFHQ $512\times 512$ unpaired I2I translation. For simplicity, we choose simple short- and long-run EBMs as a backbone of our Energy-guided Entropic OT approach, leaving the application of more sophisticated EBMs for future research. Our code is available at: https://github.com/PetrMokrov/Energy-guided-Entropic-OT

For agents

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

get_harvested_code_for_paper("2304.06094")
get_code_for_paper("2304.06094")
have("2304.06094")

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

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

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

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

Connect an agent — have() is free.