SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.09191 · 2022

Revisiting Global Pooling through the Lens of Optimal Transport

arXiv · PDF · Open in the Atlas

Code that ran

14 of 15 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, 0 violated it and 12 have no contract verdict; 1 failure of our instrument; 1 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/2201.09191.json · badge: /api/ran/2201.09191.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
sds-lab/rot-pooling community (classifier label)
classifier basis not recorded on the link
14 ran · 1 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sds-lab/rot-pooling/backbones/resnet_imagenet.py
code served (permissive licence) · get_code("131a82fd65128218")
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 list, 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 torch

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
num_classes = 4

# output: logits/scores tensor of shape (batch_size, num_classes)
output = torch.randn(batch_size, num_classes)

# target: class indices tensor of shape (batch_size,)
target = torch.tensor([1, 3])

# topk: tuple of k values to compute accuracy for
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk,
}
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 list, ndim 2, dtype family float — a list 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
get_dim Ran
ran on a synthesized input
sds-lab/rot-pooling/backbones/attention_mil.py
code served (permissive licence) · get_code("ec8c933c0c321597")
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 int, ndim 0, dtype family int, 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 scipy.io as sio
import tempfile
import os
import numpy as np

# Create a temporary .mat file with the expected structure
temp_dir = tempfile.mkdtemp()
dataset_path = os.path.join(temp_dir, 'test_dataset')

# Create mock data with the structure the function expects
# The function accesses data['data'][0, 0] and then takes the first row
# It returns len(ins_fea[0]) - 1
mock_data = {
    'data': np.array([[np.array([np.array([1.0, 2.0, 3.0, 4.0, 5.0])])]], dtype=object)
}

sio.savemat(dataset_path + '.mat', mock_data)

ARGS = {
    'dataset': dataset_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
global_softmax_pooling Ran
ran on a synthesized input
sds-lab/rot-pooling/pooling/baselines.py
code served (permissive licence) · get_code("9d7c914f74cff214")
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
from torch_geometric.nn import global_add_pool, global_max_pool, global_mean_pool
from torch_geometric.utils import softmax

torch.manual_seed(0)

# Create small tensors for the function
n = 6  # number of nodes
d = 4  # feature dimension
B = 2  # number of bags/graphs

# x: (n, d) node feature matrix
x = torch.randn(n, d)

# alpha: (n, 1) attention weights
alpha = torch.randn(n, 1)

# batch: (n,) vector indicating which bag each node belongs to
# Each element in {0, 1, ..., B-1}
batch = torch.tensor([0, 0, 0, 1, 1, 1], dtype=torch.long)

ARGS = {
    "x": x,
    "alpha": alpha,
    "batch": batch
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — 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
initialize_edge_weight Ran
ran on a synthesized input
sds-lab/rot-pooling/backbones/adgcl.py
code served (permissive licence) · get_code("e5f5692f50afab40")
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 Data. 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

torch.manual_seed(0)

class Data:
    def __init__(self):
        self.edge_index = torch.tensor([[0, 1, 2], [1, 2, 0]], dtype=torch.long)
        self.edge_weight = None

data = Data()

ARGS = {
    "data": data
}
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 Data — a Data output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Data 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
initialize_node_features Ran
ran on a synthesized input
sds-lab/rot-pooling/backbones/adgcl.py
code served (permissive licence) · get_code("4765da09c326c59f")
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 MockData. 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

torch.manual_seed(0)

class MockData:
    def __init__(self):
        self.edge_index = torch.tensor([[0, 1, 2], [1, 2, 0]], dtype=torch.long)

data = MockData()

ARGS = {
    "data": data
}
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 MockData — a MockData output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockData 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
load_mil_data_mat Ran
ran on a synthesized input
sds-lab/rot-pooling/backbones/attention_mil.py
code served (permissive licence) · get_code("a919d94d33818c15")
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 list, 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 numpy as np
import scipy.io as sio
import tempfile
import os

torch.manual_seed(0)

# Create a temporary .mat file with the expected structure
temp_dir = tempfile.mkdtemp()
mat_file_path = os.path.join(temp_dir, "test_dataset")

# Create synthetic data matching the expected format
# instances should be a list where each element is [bag_data, label]
# bag_data is a matrix where columns are features, last column is ignored
# label is a scalar

num_bags = 6
num_instances_per_bag = 3
num_features = 5  # +1 for the ignored column

instances = []
for i in range(num_bags):
    # Create bag data: shape (num_instances_per_bag, num_features + 1)
    bag_data = np.random.randn(num_instances_per_bag, num_features + 1).astype(np.float32)
    # Create label: scalar value
    label = np.array([[i % 2]], dtype=np.float32)  # 0 or 1
    instances.append(np.array([bag_data, label], dtype=object))

# Save to .mat file
sio.savemat(mat_file_path + ".mat", {"data": np.array(instances, dtype=object)})

ARGS = {
    "dataset": mat_file_path,
    "n_folds": 2,
    "batch_size": 2,
    "normalize": True,
    "split": 0.75,
    "seed": 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn, torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
org_batch Ran
ran on a synthesized input
sds-lab/rot-pooling/backbones/ddi_gin.py
code served (permissive licence) · get_code("9a2e477393a1dffe")
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. 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

ARGS = {
    "num": [[2, 1], [3], [4, 2, 3], [2, 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 tuple — a tuple output has no array shape of its own; none is 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
rot_sinkhorn Ran
ran on a synthesized input
sds-lab/rot-pooling/pooling/rotlayers.py
code served (permissive licence) · get_code("72b6375204b98c11")
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, 5, 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)

# Define dimensions
B = 2  # batch size
N = 5  # number of samples
D = 4  # dimensionality

# Create tensors with appropriate shapes
x = torch.randn(B, N, D)
c1 = torch.randn(B, D, D)
c2 = torch.randn(B, N, N)
p0 = torch.abs(torch.randn(B, 1, D)) + 0.1  # ensure positive
q0 = torch.abs(torch.randn(B, N, 1)) + 0.1  # ensure positive
mask = torch.ones(B, N, 1)

# Weight vectors for outer iterations
num_outer = 4
a0 = torch.randn(num_outer)
a1 = torch.abs(torch.randn(num_outer)) + 0.1  # ensure positive
a2 = torch.abs(torch.randn(num_outer)) + 0.1  # ensure positive
a3 = torch.abs(torch.randn(num_outer)) + 0.1  # ensure positive

# Other parameters
num = 4
inner = 5
eps = 1e-08

ARGS = {
    'x': x,
    'c1': c1,
    'c2': c2,
    'p0': p0,
    'q0': q0,
    'a0': a0,
    'a1': a1,
    'a2': a2,
    'a3': a3,
    'mask': mask,
    'num': num,
    'inner': inner,
    'eps': eps,
}
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, 5, 4) — shape (2, 5, 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
set_tu_dataset_y_shape Ran
ran on a synthesized input
sds-lab/rot-pooling/backbones/adgcl.py
code served (permissive licence) · get_code("382c92abf2446b95")
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 MockData. 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)

class MockData:
    def __init__(self):
        self.y = torch.tensor([[1.0], [2.0]])

data = MockData()

ARGS = {
    "data": data
}
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 MockData — a MockData output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockData 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
to_sparse_batch Ran
ran on a synthesized input
sds-lab/rot-pooling/pooling/rotpooling.py
code served (permissive licence) · get_code("1d61626dd637955d")
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. 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

torch.manual_seed(0)

# Define test data
# x: tensor of shape (B, Nmax, D) where B=2 (batch size), Nmax=3 (max nodes), D=4 (feature dim)
x = torch.randn(2, 3, 4)

# mask: tensor of shape (B, Nmax) indicating which nodes are valid
# First graph has 2 valid nodes, second graph has 3 valid nodes
mask = torch.tensor([
    [True, True, False],
    [True, True, True]
])

ARGS = {
    "x": x,
    "mask": mask
}
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 — a tuple output has no array shape of its own; none is 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
train Ran
ran on a synthesized input
sds-lab/rot-pooling/backbones/ddi_gin.py
code served (permissive licence) · get_code("954a0c90bea1cc24")
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 float, 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
import torch.nn as nn
from torch.optim import Adam

torch.manual_seed(0)

# Create a minimal model that accepts (data, device) and returns output
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
    
    def forward(self, data, device):
        # Expects data to have x attribute with shape (batch_size, 4)
        return self.linear(data.x)

# Create a minimal batch data class
class MinimalBatch:
    def __init__(self, batch_size=2, num_graphs=2):
        self.x = torch.randn(batch_size, 4)
        self.y = torch.randn(batch_size, 1)
        self.num_graphs = num_graphs

# Create train dataset (list of batches)
train_dataset = [MinimalBatch(batch_size=2, num_graphs=2) for _ in range(3)]

# Create train loader (iterable of batches)
train_loader = train_dataset

# Create model, optimizer, and criterion
model = MinimalModel()
optimizer = Adam(model.parameters(), lr=0.01)
crit = nn.MSELoss()

# Device (CPU only)
device = torch.device('cpu')

ARGS = {
    'model': model,
    'optimizer': optimizer,
    'crit': crit,
    'train_loader': train_loader,
    'train_dataset': train_dataset,
    'device': device
}
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 float, 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
uot_badmm Ran
ran on a synthesized input
sds-lab/rot-pooling/pooling/rotlayers.py
code served (permissive licence) · get_code("8ab6d9d56daf6d67")
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, 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 torch

torch.manual_seed(0)

# Small dimensions: B=2 (batch), N=3 (samples), D=4 (dimensions)
B, N, D = 2, 3, 4
num_iterations = 4

# x: (B, N, D) - matrix with N samples, each D-dimensional
x = torch.randn(B, N, D)

# p0: (B, 1, D) - marginal prior of dimensions
p0 = torch.softmax(torch.randn(B, 1, D), dim=2)

# q0: (B, N, 1) - marginal prior of samples
q0 = torch.softmax(torch.randn(B, N, 1), dim=1)

# a1: (num,) - weight of entropic term
a1 = torch.ones(num_iterations) * 0.1

# a2: (num,) - weight of KL term of p0
a2 = torch.ones(num_iterations) * 0.1

# a3: (num,) - weight of KL term of q0
a3 = torch.ones(num_iterations) * 0.1

# rho: (num,) - learning rate of ADMM
rho = torch.ones(num_iterations) * 0.5

# mask: (B, N, 1) - masking tensor
mask = torch.ones(B, N, 1)

# num: number of Bregman ADMM iterations
num = num_iterations

# eps: epsilon to avoid numerical instability
eps = 1e-08

ARGS = {
    "x": x,
    "p0": p0,
    "q0": q0,
    "a1": a1,
    "a2": a2,
    "a3": a3,
    "rho": rho,
    "mask": mask,
    "num": num,
    "eps": eps,
}
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, 3, 4) — shape (2, 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
uot_sinkhorn Ran
ran on a synthesized input
sds-lab/rot-pooling/pooling/rotlayers.py
code served (permissive licence) · get_code("f3ed0e56606b76fe")
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, 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 torch

torch.manual_seed(0)

# Define tensor dimensions
B = 2  # batch size
N = 3  # number of samples
D = 4  # dimensionality

# x: (B, N, D) - matrix with N samples, each D-dimensional
x = torch.randn(B, N, D)

# p0: (B, 1, D) - marginal prior of dimensions
p0 = torch.softmax(torch.randn(B, 1, D), dim=2)

# q0: (B, N, 1) - marginal prior of samples
q0 = torch.softmax(torch.randn(B, N, 1), dim=1)

# a1: (num,) - weight of entropic term
num = 4
a1 = torch.ones(num) * 0.1

# a2: (num,) - weight of KL term of p0
a2 = torch.ones(num) * 0.1

# a3: (num,) - weight of KL term of q0
a3 = torch.ones(num) * 0.1

# mask: (B, N, 1) - masking tensor
mask = torch.ones(B, N, 1)

# num: number of outer iterations
num_iter = 4

# eps: epsilon to avoid numerical instability
eps = 1e-8

ARGS = {
    "x": x,
    "p0": p0,
    "q0": q0,
    "a1": a1,
    "a2": a2,
    "a3": a3,
    "mask": mask,
    "num": num_iter,
    "eps": eps,
}
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, 3, 4) — shape (2, 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
validate Ran
ran, honoured the contract we drafted
sds-lab/rot-pooling/backbones/resnet_imagenet.py
code served (permissive licence) · get_code("f7cef679653b52d5")
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 0, dtype family float, shape () 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
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 10)
    
    def forward(self, x):
        return self.fc(x)

# Create a simple criterion
criterion = nn.CrossEntropyLoss()

# Create a simple data loader (list of batches)
val_loader = [
    (torch.randn(2, 4), torch.randint(0, 10, (2,))),
    (torch.randn(2, 4), torch.randint(0, 10, (2,))),
]

# Create model
model = SimpleModel()

# Create args object
class Args:
    def __init__(self):
        self.gpu = None
        self.print_freq = 1

args = Args()

ARGS = {
    'val_loader': val_loader,
    'model': model,
    'criterion': criterion,
    'args': args,
}
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 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
train Not yet run
unverified (harvested, no recorded run)
sds-lab/rot-pooling/backbones/attention_mil.py
code served (permissive licence) · get_code("3ce20c8e0eb7e9c5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 2 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
accuracy 116 other papers
34 dated earlier, 1 the same month, 77 later, 4 same year, order not determinable · 8 only as an assembly brick
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1610.05820 (2016-10)
Membership Inference Attacks Against Machine Learning Models
1905.03696 (2019-05)
HAWQ: Hessian AWare Quantization of Neural Networks with Mixed-Precision
and 113 more not named here
validate 1 other paper
1 later
2202.12002 (2022-02)
Rare Gems: Finding Lottery Tickets at Initialization

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

Global pooling is one of the most significant operations in many machine learning models and tasks, whose implementation, however, is often empirical in practice. In this study, we develop a novel and solid global pooling framework through the lens of optimal transport. We demonstrate that most existing global pooling methods are equivalent to solving some specializations of an unbalanced optimal transport (UOT) problem. Making the parameters of the UOT problem learnable, we unify various global pooling methods in the same framework, and accordingly, propose a generalized global pooling layer called UOT-Pooling (UOTP) for neural networks. Besides implementing the UOTP layer based on the classic Sinkhorn-scaling algorithm, we design a new model architecture based on the Bregman ADMM algorithm, which has better numerical stability and can reproduce existing pooling layers more effectively. We test our UOTP layers in several application scenarios, including multi-instance learning, graph classification, and image classification. Our UOTP layers can either imitate conventional global pooling layers or learn some new pooling mechanisms leading to better performance.

For agents

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

get_harvested_code_for_paper("2201.09191")
get_code_for_paper("2201.09191")
have("2201.09191")

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

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

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

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

Connect an agent — have() is free.