SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.00976 · ICCV · 2023

TMR: Text-to-Motion Retrieval Using Contrastive 3D Human Motion Synthesis

Michael Black, Gül Varol, Mathis Petrovich

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 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 2 have no contract verdict; 6 failures of our instrument; 3 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/2305.00976.json · badge: /api/ran/2305.00976.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
Mathux/TMR community
Papers with Code archive
9 ran · 3 no recorded run
FunctionStatusWhere it lives
InfoNCE_with_filtering Ran
ran on a synthesized input
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("741be0f1e89597a0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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.functional as F

class InfoNCE_with_filtering:

    def __init__(self, temperature=0.7, threshold_selfsim=0.8):
        self.temperature = temperature
        self.threshold_selfsim = threshold_selfsim

    def get_sim_matrix(self, x, y):
        x_logits = torch.nn.functional.normalize(x, dim=-1)
        y_logits = torch.nn.functional.normalize(y, dim=-1)
        sim_matrix = x_logits @ y_logits.T
        return sim_matrix

    def __call__(self, x, y, sent_emb=None):
        bs, device = (len(x), x.device)
        sim_matrix = self.get_sim_matrix(x, y) / self.temperature
        if sent_emb is not None and self.threshold_selfsim:
            real_threshold_selfsim = 2 * self.threshold_selfsim - 1
            selfsim = sent_emb @ sent_emb.T
            selfsim_nodiag = selfsim - selfsim.diag().diag()
            idx = torch.where(selfsim_nodiag > real_threshold_selfsim)
            sim_matrix[idx] = -torch.inf
        labels = torch.arange(bs, device=device)
        total_loss = (F.cross_entropy(sim_matrix, labels) + F.cross_entropy(sim_matrix.T, labels)) / 2
        return total_loss

    def __repr__(self):
        return f'Constrastive(temp={self.temperature})'


INIT_ARGS = {
    'temperature': 0.7,
    'threshold_selfsim': 0.8,
}

ARGS = {
    'x': torch.randn(2, 4),
    'y': torch.randn(2, 4),
    'sent_emb': torch.randn(2, 3),
}

METHOD = '__call__'

if __name__ == '__main__':
    instance = InfoNCE_with_filtering(**INIT_ARGS)
    result = instance(**ARGS)
    print(f"Result: {result}")
    print(f"Result shape: {result.shape}")
    print(f"Result type: {type(result)}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
KLLoss Ran
ran on a synthesized input
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("7742734b4ba50302")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, 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

class KLLoss:

    def __call__(self, q, p):
        mu_q, logvar_q = q
        mu_p, logvar_p = p
        log_var_ratio = logvar_q - logvar_p
        t1 = (mu_p - mu_q).pow(2) / logvar_p.exp()
        div = 0.5 * (log_var_ratio.exp() + t1 - 1 - log_var_ratio)
        return div.mean()

    def __repr__(self):
        return 'KLLoss()'


INIT_ARGS = {}

ARGS = {
    'q': (
        torch.randn(2, 4),
        torch.randn(2, 4)
    ),
    'p': (
        torch.randn(2, 4),
        torch.randn(2, 4)
    )
}

METHOD = '__call__'

if __name__ == '__main__':
    loss_fn = KLLoss(**INIT_ARGS)
    result = loss_fn(**ARGS)
    print(f"KLLoss result: {result}")
    print(f"Result shape: {result.shape}")
    print(f"Result type: {type(result)}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
all_contrastive_metrics Ran
ran; our contract draft was wrong, not the code
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("6c77bd6ecc1b5f00")
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 numpy as np

# Create similarity matrix (n x m where n == m)
# Using distinct size 4x4 to have enough queries
np.random.seed(0)
n = 4
sims = np.random.randn(n, n).astype(np.float32)
# Make it somewhat valid by ensuring diagonal has some high values
sims[np.diag_indices(n)] += 2.0

# Create embeddings for text_selfsim calculation
# Shape should be (n, d) where d is embedding dimension
emb = np.random.randn(n, 3).astype(np.float32)

# threshold parameter - used to filter text_selfsim
threshold = 0.5

# rounding parameter
rounding = 2

# return_cols parameter
return_cols = False

ARGS = {
    'sims': sims,
    'emb': emb,
    'threshold': threshold,
    'rounding': rounding,
    'return_cols': return_cols,
}
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 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
break_ties_average Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("2eaeeecbcc2bce92")
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 ndarray, 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 numpy as np

# Define the input parameters for the function break_ties_average
sorted_dists = np.array([[0.1, 0.2, 0.3, 0.4],
                         [0.5, 0.6, 0.7, 0.8]])

gt_dists = np.array([[0.1, 0.2, 0.3, 0.4],
                     [0.5, 0.6, 0.7, 0.8]])

ARGS = {
    'sorted_dists': sorted_dists,
    'gt_dists': gt_dists
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
break_ties_optimistically Ran
ran, honoured the contract we drafted
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("8837faea84531612")
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 ndarray, ndim 1, dtype family int, shape (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 numpy as np

# Construct valid arguments for break_ties_optimistically
# The function takes sorted_dists and gt_dists as numpy arrays
# It finds where sorted_dists equals gt_dists, then returns unique column indices

# Create small numpy arrays with some matching values
sorted_dists = np.array([
    [1.0, 2.0, 3.0],
    [1.5, 2.5, 3.5],
    [0.5, 1.5, 2.5]
], dtype=np.float32)

gt_dists = np.array([
    [1.0, 2.5, 3.0],
    [1.5, 2.5, 4.0],
    [0.5, 1.5, 2.5]
], dtype=np.float32)

ARGS = {
    "sorted_dists": sorted_dists,
    "gt_dists": gt_dists
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 1, dtype family int, shape (3,) — shape (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
cols2metrics Ran
ran; our contract draft was wrong, not the code
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("a666387ccfdf74bd")
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 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 numpy as np

# cols2metrics expects:
# - cols: array-like of numeric values (used with np.sum and np.median)
# - num_queries: int (used in division)
# - rounding: int or None (optional, defaults to 2)

# Create a small numpy array of rank values
cols = np.array([0, 1, 2, 4, 8, 15, 20, 25])

# Number of queries
num_queries = 8

# Rounding parameter
rounding = 2

ARGS = {
    'cols': cols,
    'num_queries': num_queries,
    'rounding': rounding
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
get_sim_matrix Ran
ran; our contract draft was wrong, not the code
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("8f87ba84f2a8ebd7")
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 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 small tensors with distinct dimensions
# x: shape (2, 4) - batch size 2, embedding dim 4
# y: shape (3, 4) - batch size 3, embedding dim 4
x = torch.randn(2, 4)
y = torch.randn(3, 4)

ARGS = {
    "x": x,
    "y": y,
}
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 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
length_to_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("e852f499f639146d")
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 Tensor, ndim 2, dtype family float, shape (3, 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)

ARGS = {
    'length': [2, 3, 1],
    'device': None
}
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 Tensor, ndim 2, dtype family float, shape (3, 3) — shape (3, 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
transpose Ran
ran; our contract draft was wrong, not the code
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("129462f7f783e0f3")
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 Tensor, ndim 4, dtype family float, shape (5, 4, 3, 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 takes a tensor x and permutes its dimensions in reverse order
# We need to create a tensor with distinct dimensions to test the transpose

x = torch.randn(2, 3, 4, 5)  # 4D tensor with distinct sizes

ARGS = {
    "x": x
}
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 Tensor, ndim 4, dtype family float, shape (5, 4, 3, 2) — shape (5, 4, 3, 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
TEMOS Not yet run
unverified (harvested, no recorded run)
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("d0dce6a339845713")
How it ran

no invocation recorded.

TMR Not yet run
unverified (harvested, no recorded run)
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("70c2a5a5837894e3")
How it ran

no invocation recorded.

contrastive_metrics Not yet run
unverified (harvested, no recorded run)
Mathux/TMR/src/model/tmr.py
code served (permissive licence) · get_code("844c670c33598db4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 10 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
get_sim_matrix
brick of this paper's assembly: helper
1 other paper
1 later
2510.03200 (2025-10)
MonSTeR : a Unified Model for Motion, Scene, Text Retrieval
transpose
brick of this paper's assembly: helper
1 other paper
1 later
2510.03200 (2025-10)
MonSTeR : a Unified Model for Motion, Scene, Text Retrieval

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

In this paper, we present TMR, a simple yet effective approach for text to 3D human motion retrieval. While previous work has only treated retrieval as a proxy evaluation metric, we tackle it as a standalone task. Our method extends the state-of-theart text-to-motion synthesis model TEMOS, and incorporates a contrastive loss to better structure the cross-modal latent space. We show that maintaining the motion generation loss, along with the contrastive training, is crucial to obtain good performance. We introduce a benchmark for evaluation and provide an in-depth analysis by reporting results on several protocols. Our extensive experiments on the KIT-ML and HumanML3D datasets show that TMR outperforms the prior work by a significant margin, for example reducing the median rank from 54 to 19. Finally, we showcase the potential of our approach on moment retrieval. Our code and models are publicly available at https://mathis.petrovich.fr/tmr.

For agents

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

get_harvested_code_for_paper("2305.00976")
get_code_for_paper("2305.00976")
have("2305.00976")

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

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

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

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

Connect an agent — have() is free.