SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1805.07594 · 2018

Generalizing Point Embeddings using the Wasserstein Space of Elliptical Distributions

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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 7 have no contract verdict; 0 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/1805.07594.json · badge: /api/ran/1805.07594.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
albpurpura/PE4IR community (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
FunctionStatusWhere it lives
compute_sim_matrices_w2v Ran
ran on a synthesized input
albpurpura/PE4IR/MP_original/data_utils.py
code served (permissive licence) · get_code("cd253ddb46b812f6")
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 3, 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

# Create a small word2vec-style embedding dictionary
w = {
    'query_word_1': np.array([0.1, 0.2, 0.3, 0.4]),
    'query_word_2': np.array([0.5, 0.6, 0.7, 0.8]),
    'doc_word_1': np.array([0.2, 0.3, 0.4, 0.5]),
    'doc_word_2': np.array([0.6, 0.7, 0.8, 0.9]),
    'doc_word_3': np.array([0.1, 0.1, 0.1, 0.1]),
}

# Create sample queries and documents
queries = [
    ['query_word_1', 'query_word_2'],
    ['query_word_1']
]

documents = [
    ['doc_word_1', 'doc_word_2', 'doc_word_3'],
    ['doc_word_2']
]

max_q_len = 3
max_d_len = 5

ARGS = {
    'queries': queries,
    'documents': documents,
    'max_q_len': max_q_len,
    'max_d_len': max_d_len,
    'w': w
}
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 list, ndim 3, 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
convert_we_dict_to_emb_matrix Ran
ran on a synthesized input
albpurpura/PE4IR/MP_original/main_MP_original.py
code served (permissive licence) · get_code("656d40d494a8804d")
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 (6, 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 numpy as np

# Construct a small word embedding dictionary
# Keys are integer indices, values are embedding vectors
wed = {
    0: np.array([0.01, -0.01, 0.005, -0.005], dtype=np.float32),
    1: np.array([-0.015, 0.02, -0.01, 0.015], dtype=np.float32),
    2: np.array([0.002, -0.008, 0.012, -0.003], dtype=np.float32),
    5: np.array([0.018, 0.001, -0.019, 0.004], dtype=np.float32),
}

ARGS = {
    "wed": wed,
    "we_size": 4,
}
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 ndarray, ndim 2, dtype family float, shape (6, 4) — shape (6, 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
get_retrieved_doc_names_for_qry Ran
ran on a synthesized input
albpurpura/PE4IR/MP_WN_WE/data_utils.py
code served (permissive licence) · get_code("92b95fcd4eaa9926")
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 dict. 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 tempfile
import os

# Create a temporary file with ground truth data in the expected format
# Format: qn dn_id dn rj (where rj is relevance judgment)
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("q1 0 doc1 1\n")
temp_file.write("q1 1 doc2 1\n")
temp_file.write("q1 2 doc3 0\n")
temp_file.write("q2 0 doc4 1\n")
temp_file.write("q2 1 doc5 1\n")
temp_file.write("q3 0 doc6 0\n")
temp_file.close()

ARGS = {
    "gt": temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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_json Ran
ran on a synthesized input
albpurpura/PE4IR/MP_WN_WE/util.py
code served (permissive licence) · get_code("066e4dbaa7dc5bcd")
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 dict. 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 json
import tempfile
import os

# Create a temporary JSON file with valid content
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test.json")

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with open(temp_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    "path": temp_file
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
run_trec_eval Ran
ran on a synthesized input
albpurpura/PE4IR/MP_WN_WE/util.py
code served (permissive licence) · get_code("d57c0af7ad16200a")
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 os
import tempfile
import subprocess

# Create temporary mock files for testing
temp_dir = tempfile.mkdtemp()

# Create a mock qrels file
qrels_file = os.path.join(temp_dir, 'mock.qrel')
with open(qrels_file, 'w') as f:
    f.write("1 0 doc1 1\n")
    f.write("1 0 doc2 0\n")

# Create a mock run file
run_file = os.path.join(temp_dir, 'mock_run.txt')
with open(run_file, 'w') as f:
    f.write("1 Q0 doc1 1 10.5 test\n")
    f.write("1 Q0 doc2 2 9.5 test\n")

# Create a mock trec_eval executable (just echo a valid response)
trec_eval_path = os.path.join(temp_dir, 'trec_eval')
with open(trec_eval_path, 'w') as f:
    f.write("#!/bin/bash\n")
    f.write("echo 'map\tall\t0.5'\n")
os.chmod(trec_eval_path, 0o755)

# Change to temp directory so relative paths work
os.chdir(temp_dir)

ARGS = {
    'trec_eval_path': trec_eval_path,
    'qrels_file': qrels_file,
    'run_to_eval': run_file
}
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 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
run_trec_eval Ran
ran on a synthesized input
albpurpura/PE4IR/MP_original/util.py
code served (permissive licence) · get_code("eac6eded7005496e")
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 os
import tempfile
import subprocess

# Create temporary files to simulate the qrels and run output files
temp_dir = tempfile.mkdtemp()

# Create a minimal valid qrels file
qrels_content = """1 0 doc1 1
1 0 doc2 2
2 0 doc3 1"""

qrels_file = os.path.join(temp_dir, 'test.qrel')
with open(qrels_file, 'w') as f:
    f.write(qrels_content)

# Create a minimal valid trec run file
run_content = """1 Q0 doc1 1 10.5 system1
1 Q0 doc2 2 9.5 system1
2 Q0 doc3 1 8.5 system1"""

run_file = os.path.join(temp_dir, 'test_run.txt')
with open(run_file, 'w') as f:
    f.write(run_content)

# Create a mock trec_eval script that returns a valid map line
trec_eval_dir = os.path.join(temp_dir, 'trec_eval.8.1')
os.makedirs(trec_eval_dir, exist_ok=True)

trec_eval_script = os.path.join(trec_eval_dir, 'trec_eval')
with open(trec_eval_script, 'w') as f:
    f.write("""#!/bin/bash
echo "map\tall\t0.5"
""")
os.chmod(trec_eval_script, 0o755)

ARGS = {
    'trec_eval_path': os.path.join(temp_dir, 'trec_eval.8.1', 'trec_eval'),
    'qrels_file': qrels_file,
    'run_to_eval': run_file
}
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 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
sample_neg_doc Ran
ran on a synthesized input
albpurpura/PE4IR/MP_original/data_utils.py
code served (permissive licence) · get_code("54dde80bde539606")
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 str_. 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 numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create sample document names
all_d_names = np.array(['doc_1', 'doc_2', 'doc_3', 'doc_4', 'doc_5'])

# Create a set of relevant document names to avoid
rel_doc_names_to_avoid = {'doc_1', 'doc_3'}

ARGS = {
    'all_d_names': all_d_names,
    'rel_doc_names_to_avoid': rel_doc_names_to_avoid
}
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 str_ — a str_ output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str_ 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_model Not yet run
unverified (harvested, no recorded run)
albpurpura/PE4IR/MP_WN_WE/util.py
code served (permissive licence) · get_code("1bc245f33b630412")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 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
load_json 1 other paper
1 later
2010.03790 (2020-10)
Text-based RL Agents with Commonsense Knowledge: New Challenges, Environments and Baselines

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

Embedding complex objects as vectors in low dimensional spaces is a longstanding problem in machine learning. We propose in this work an extension of that approach, which consists in embedding objects as elliptical probability distributions, namely distributions whose densities have elliptical level sets. We endow these measures with the 2-Wasserstein metric, with two important benefits: (i) For such measures, the squared 2-Wasserstein metric has a closed form, equal to a weighted sum of the squared Euclidean distance between means and the squared Bures metric between covariance matrices. The latter is a Riemannian metric between positive semi-definite matrices, which turns out to be Euclidean on a suitable factor representation of such matrices, which is valid on the entire geodesic between these matrices. (ii) The 2-Wasserstein distance boils down to the usual Euclidean metric when comparing Diracs, and therefore provides a natural framework to extend point embeddings. We show that for these reasons Wasserstein elliptical embeddings are more intuitive and yield tools that are better behaved numerically than the alternative choice of Gaussian embeddings with the Kullback-Leibler divergence. In particular, and unlike previous work based on the KL geometry, we learn elliptical distributions that are not necessarily diagonal. We demonstrate the advantages of elliptical embeddings by using them for visualization, to compute embeddings of words, and to reflect entailment or hypernymy.

For agents

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

get_harvested_code_for_paper("1805.07594")
get_code_for_paper("1805.07594")
have("1805.07594")

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

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

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

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

Connect an agent — have() is free.