SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1805.07010 · 2018

Learning Permutations with Sinkhorn Policy Gradient

arXiv · PDF · Open in the Atlas

Code that ran

5 of 10 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; 1 honoured the contract we drafted, 1 violated it and 3 have no contract verdict; 0 failures of our instrument; 5 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/1805.07010.json · badge: /api/ran/1805.07010.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
pemami4911/sinkhorn-policy-gradient.pytorch community (classifier label)
classifier basis not recorded on the link
5 ran · 5 no recorded run
FunctionStatusWhere it lives
array_min2d Ran
ran, honoured the contract we drafted
pemami4911/sinkhorn-policy-gradient.pytorch/spg/memory.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from MouseHu/GEM, is pointer only (licence: NONE) · get_code("6dd69b9b76d320b4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from MouseHu/GEM, and GitHub detected no licence in that repository 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.

reward Ran
ran on a synthesized input
pemami4911/sinkhorn-policy-gradient.pytorch/envs/mwm2D_task.py
code served (permissive licence) · get_code("fbcc4ff1d7572f35")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch.autograd import Variable

torch.manual_seed(0)

# The function expects:
# - matching: Tensor of dim [batch, N, 2]
#   where batch is batch_size, N is number of points, 2 is features
#   The function computes distances between matching[:, i+M, :] and matching[:, i, :]
#   where M = N/2, so N must be even
# - use_cuda: boolean flag

batch_size = 2
N = 4  # Must be even so that M = N/2 = 2
features = 2

# Create a matching tensor of shape [batch_size, N, features] = [2, 4, 2]
matching = torch.randn(batch_size, N, features)

# use_cuda should be False (CPU only)
use_cuda = False

ARGS = {
    "matching": matching,
    "use_cuda": use_cuda,
}
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
reward_nco Ran
ran on a synthesized input
pemami4911/sinkhorn-policy-gradient.pytorch/envs/mwm2D_task.py
code served (permissive licence) · get_code("897b35a435866750")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch.autograd import Variable

torch.manual_seed(0)

# The function reward_nco calls reward(matching, use_cuda)
# reward expects:
#   - matching: Tensor of dim [batch, N, 2]
#   - use_cuda: boolean
# 
# The function uses matching.size() to get batch_size, N, features
# It then iterates M = N/2 times, accessing matching[:, i+M, :] and matching[:, i, :]
# So N must be even. Let's use N=4, so M=2
# matching is [batch=2, N=4, features=2]

batch_size = 2
N = 4
features = 2

# Create a tensor of shape [batch, N, 2]
matching = torch.randn(batch_size, N, features)

# use_cuda should be False (CPU only)
use_cuda = False

ARGS = {
    "matching": matching,
    "use_cuda": use_cuda,
}
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
reward_nco Ran
ran on a synthesized input
pemami4911/sinkhorn-policy-gradient.pytorch/envs/tsp_task.py
code served (permissive licence) · get_code("5a75eb99cba9891c")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch.autograd import Variable

torch.manual_seed(0)

batch_size = 2
n_points = 5
coord_dim = 4

# Create a list of n_points tensors, each of shape [batch_size, coord_dim]
# representing coordinates in a tour
sample_solution = [
    torch.randn(batch_size, coord_dim) for _ in range(n_points)
]

ARGS = {
    "sample_solution": sample_solution,
    "use_cuda": False,
}
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
str2bool Ran
ran, violated the contract we drafted
pemami4911/sinkhorn-policy-gradient.pytorch/train_nco.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from haoran0301/amenunet, is pointer only (licence: NONE) · get_code("248284f69adfeaad")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from haoran0301/amenunet, and GitHub detected no licence in that repository 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.

download_file_from_google_drive Not yet run
unverified (harvested, no recorded run)
pemami4911/sinkhorn-policy-gradient.pytorch/envs/tsp_task.py
code served (permissive licence) · get_code("500e7106751f6ddf")
How it ran

no invocation recorded.

reward_ddpg_A Not yet run
unverified (harvested, no recorded run)
pemami4911/sinkhorn-policy-gradient.pytorch/envs/sorting_task.py
code served (permissive licence) · get_code("3cfb4f8ceec0755c")
How it ran

no invocation recorded.

reward_ddpg_B Not yet run
unverified (harvested, no recorded run)
pemami4911/sinkhorn-policy-gradient.pytorch/envs/sorting_task.py
code served (permissive licence) · get_code("231f961891da4b54")
How it ran

no invocation recorded.

reward_nco Not yet run
unverified (harvested, no recorded run)
pemami4911/sinkhorn-policy-gradient.pytorch/envs/sorting_task.py
code served (permissive licence) · get_code("7db1ec87169e246b")
How it ran

no invocation recorded.

reward_spg Not yet run
unverified (harvested, no recorded run)
pemami4911/sinkhorn-policy-gradient.pytorch/envs/tsp_task.py
code served (permissive licence) · get_code("05adf444acd0d22d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 2 later) and 7 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 33 other papers
9 dated earlier, 2 the same month, 22 later
1406.6247 (2014-06)
Recurrent Models of Visual Attention
1506.03134 (2015-06)
Pointer Networks
1611.09940 (2016-11)
Neural Combinatorial Optimization with Reinforcement Learning
and 30 more not named here
array_min2d 2 other papers
2 later
1806.07851 (2018-06)
Sim-to-Real Reinforcement Learning for Deformable Object Manipulation
2103.06469 (2021-03)
Generalizable Episodic Memory for Deep Reinforcement Learning
download_file_from_google_drive 2 other papers
2 dated earlier
1506.03134 (2015-06)
Pointer Networks
1611.09940 (2016-11)
Neural Combinatorial Optimization with Reinforcement Learning

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

Many problems at the intersection of combinatorics and computer science require solving for a permutation that optimally matches, ranks, or sorts some data. These problems usually have a task-specific, often non-differentiable objective function that data-driven algorithms can use as a learning signal. In this paper, we propose the Sinkhorn Policy Gradient (SPG) algorithm for learning policies on permutation matrices. The actor-critic neural network architecture we introduce for SPG uniquely decouples representation learning of the state space from the highly-structured action space of permutations with a temperature-controlled Sinkhorn layer. The Sinkhorn layer produces continuous relaxations of permutation matrices so that the actor-critic architecture can be trained end-to-end. Our empirical results show that agents trained with SPG can perform competitively on sorting, the Euclidean TSP, and matching tasks. We also observe that SPG is significantly more data efficient at the matching task than the baseline methods, which indicates that SPG is conducive to learning representations that are useful for reasoning about permutations.

For agents

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

get_harvested_code_for_paper("1805.07010")
get_code_for_paper("1805.07010")
have("1805.07010")

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

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

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

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

Connect an agent — have() is free.