SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.14744 · 2020

Graph Optimal Transport for Cross-Domain Alignment

arXiv · PDF · Open in the Atlas

Code that ran

9 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, 2 violated it and 4 have no contract verdict; 2 failures 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/2006.14744.json · badge: /api/ran/2006.14744.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
LiqunChen0606/Graph-Optimal-Transport canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
IPOT_distance_torch Ran
ran on a synthesized input
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/OT_torch_.py
code served (permissive licence) · get_code("b1e24c9598daad69")
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

torch.manual_seed(0)

# The function IPOT_distance_torch expects:
# C: a cost matrix (2D tensor)
# n: number of rows in C
# m: number of columns in C
# miu: a vector of shape (n,) representing row marginals
# nu: a vector of shape (m,) representing column marginals

# Create a small cost matrix C with shape (4, 3)
C = torch.randn(4, 3)

# n is the number of rows
n = 4

# m is the number of columns
m = 3

# miu: row marginals, shape (n,)
miu = torch.ones(n) / n

# nu: column marginals, shape (m,)
nu = torch.ones(m) / m

ARGS = {
    'C': C,
    'n': n,
    'm': m,
    'miu': miu,
    'nu': nu
}
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
IPOT_torch Ran
ran on a synthesized input
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/OT_torch_.py
code served (permissive licence) · get_code("674f9140f14e54a6")
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 (3, 4) 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 numpy as np

torch.manual_seed(0)

# Analyze the function:
# - C: cost matrix, used with torch.exp and matrix operations, shape (n, m)
# - n: number of rows, int
# - m: number of columns, int
# - miu: vector of size n, used in division
# - nu: vector of size m, used in operations
# - beta: scalar float, default 0.5

# Create small tensors with distinct dimensions
n = 3
m = 4

# C: cost matrix of shape (n, m)
C = torch.randn(n, m).float()

# miu: vector of size n
miu = torch.ones(n).float()

# nu: vector of size m
nu = torch.ones(m).float()

# beta: scalar
beta = 0.5

ARGS = {
    "C": C,
    "n": n,
    "m": m,
    "miu": miu,
    "nu": nu,
    "beta": beta
}
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 (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
answer_filter Ran
ran, violated the contract we drafted
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/dataset.py
pointer only (licence: MIT); the stored copy get_code serves, from KaveeshaSIlva/PathVQA, is pointer only (licence: NONE) · get_code("cf2efa825f4afaf0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from KaveeshaSIlva/PathVQA, 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.

compute_recall_with_logits Ran
ran on a synthesized input
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/train_flickr.py
code served (permissive licence) · get_code("5a8370941ac95d70")
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. 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 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

# logits: shape (batch_size, num_classes) - raw scores for ranking
logits = torch.randn(batch_size, num_classes)

# labels: shape (batch_size, num_classes) - multi-hot encoded labels
labels = torch.zeros(batch_size, num_classes)
labels[0, 0] = 1  # first sample has class 0 as positive
labels[0, 2] = 1  # first sample has class 2 as positive
labels[1, 1] = 1  # second sample has class 1 as positive

ARGS = {
    "logits": logits,
    "labels": labels,
}
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 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
cost_matrix_torch Ran
ran; our contract draft was wrong, not the code
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/OT_torch_.py
code served (permissive licence) · get_code("d79fd2ac61421292")
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, 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

torch.manual_seed(0)

# Create two tensors with distinct dimensions
# x: shape (4, 3) - 4 features, 3 samples
# y: shape (4, 2) - 4 features, 2 samples
x = torch.randn(4, 3)
y = torch.randn(4, 2)

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 2, dtype family float, shape (2, 3) — shape (2, 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
is_howmany Ran
ran, violated the contract we drafted
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/dataset.py
pointer only (licence: MIT); the stored copy get_code serves, from KaveeshaSIlva/PathVQA, is pointer only (licence: NONE) · get_code("ac9f54e37ab206e4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from KaveeshaSIlva/PathVQA, 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.

load_folder Ran
ran; our contract draft was wrong, not the code
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/utils.py
code served (permissive licence) · get_code("8c1252eacab71602")
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 os
import tempfile
import shutil

# Create a temporary directory with some test files
temp_dir = tempfile.mkdtemp()

# Create some test files with different suffixes
test_files = [
    "image_001.jpg",
    "image_002.jpg",
    "image_003.png",
    "readme.txt",
    "data_file.jpg",
]

for filename in test_files:
    filepath = os.path.join(temp_dir, filename)
    with open(filepath, 'w') as f:
        f.write("test content")

# Define ARGS for load_folder function
ARGS = {
    "folder": temp_dir,
    "suffix": ".jpg"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
load_imageid Ran
ran on a synthesized input
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/utils.py
code served (permissive licence) · get_code("bf90bd27fe08f3a2")
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 set. 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 os
import tempfile
import shutil

# Create a temporary directory with test image files
temp_dir = tempfile.mkdtemp()

# Create some test jpg files with names matching the expected pattern
test_files = [
    "image_001.jpg",
    "image_002.jpg",
    "image_003.jpg",
    "other_file_001.jpg",
]

for fname in test_files:
    filepath = os.path.join(temp_dir, fname)
    with open(filepath, 'w') as f:
        f.write("dummy image data")

# Define arguments for load_imageid function
ARGS = {
    "folder": temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
pil_loader Ran
ran, honoured the contract we drafted
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from YuemingJin/MTRCNet-CL, is pointer only (licence: NONE) · get_code("1df9a5ffd9b38c34")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from YuemingJin/MTRCNet-CL, 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.

evaluate Not yet run
unverified (harvested, no recorded run)
LiqunChen0606/Graph-Optimal-Transport/BAN_vqa/train_flickr.py
code served (permissive licence) · get_code("ebb43b4af422c670")
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, 9 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 8 later) and 1 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
pil_loader 28 other papers
9 dated earlier, 19 later
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
1805.07932 (2018-05)
Bilinear Attention Networks
1807.06587 (2018-07)
Deep Exemplar-based Colorization
and 25 more not named here
load_folder 7 other papers
2 dated earlier, 5 later
1805.07932 (2018-05)
Bilinear Attention Networks
1902.09368 (2019-02)
Dual Attention Networks for Visual Reference Resolution in Visual Dialog
2108.04024 (2021-08)
Image Retrieval on Real-life Images with Pre-trained Vision-and-Language Models
and 4 more not named here
answer_filter 5 other papers
4 dated earlier, 1 later
1805.07932 (2018-05)
Bilinear Attention Networks
1903.12314 (2019-03)
Relation-Aware Graph Attention Network for Visual Question Answering
1909.11874 (2019-09)
Compact Trilinear Interaction for Visual Question Answering
and 2 more not named here
is_howmany 4 other papers
3 dated earlier, 1 later
1805.07932 (2018-05)
Bilinear Attention Networks
1903.12314 (2019-03)
Relation-Aware Graph Attention Network for Visual Question Answering
2003.10286 (2020-03)
PathVQA: 30000+ Questions for Medical Visual Question Answering
and 1 more not named here
load_imageid 4 other papers
2 dated earlier, 2 later
1805.07932 (2018-05)
Bilinear Attention Networks
1902.09368 (2019-02)
Dual Attention Networks for Visual Reference Resolution in Visual Dialog
2110.02526 (2021-10)
Coarse-to-Fine Reasoning for Visual Question Answering
and 1 more not named here
cost_matrix_torch 2 other papers
2 later
2210.04135 (2022-10)
VoLTA: Vision-Language Transformer with Weakly-Supervised Local-Feature Alignment
2407.01851 (2024-07)
Meerkat: Audio-Visual Large Language Model for Grounding in Space and Time
IPOT_distance_torch 1 other paper
1 later
2210.04135 (2022-10)
VoLTA: Vision-Language Transformer with Weakly-Supervised Local-Feature Alignment
IPOT_torch 1 other paper
1 later
2210.04135 (2022-10)
VoLTA: Vision-Language Transformer with Weakly-Supervised Local-Feature Alignment
compute_recall_with_logits 1 other paper
1 dated earlier
1805.07932 (2018-05)
Bilinear Attention Networks

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

Cross-domain alignment between two sets of entities (e.g., objects in an image, words in a sentence) is fundamental to both computer vision and natural language processing. Existing methods mainly focus on designing advanced attention mechanisms to simulate soft alignment, with no training signals to explicitly encourage alignment. The learned attention matrices are also dense and lacks interpretability. We propose Graph Optimal Transport (GOT), a principled framework that germinates from recent advances in Optimal Transport (OT). In GOT, cross-domain alignment is formulated as a graph matching problem, by representing entities into a dynamically-constructed graph. Two types of OT distances are considered: (i) Wasserstein distance (WD) for node (entity) matching; and (ii) Gromov-Wasserstein distance (GWD) for edge (structure) matching. Both WD and GWD can be incorporated into existing neural network models, effectively acting as a drop-in regularizer. The inferred transport plan also yields sparse and self-normalized alignment, enhancing the interpretability of the learned model. Experiments show consistent outperformance of GOT over baselines across a wide range of tasks, including image-text retrieval, visual question answering, image captioning, machine translation, and text summarization.

For agents

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

get_harvested_code_for_paper("2006.14744")
get_code_for_paper("2006.14744")
have("2006.14744")

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

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

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

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

Connect an agent — have() is free.