SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.06247 · 2021

Video Corpus Moment Retrieval with Contrastive Learning

arXiv · PDF · Open in the Atlas

Code that ran

12 of 14 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; 3 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 4 failures of our instrument; 2 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/2105.06247.json · badge: /api/ran/2105.06247.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
IsaacChanghau/ReLoCLNet community (classifier label)
classifier basis not recorded on the link
12 ran · 2 no recorded run
FunctionStatusWhere it lives
compute_overlap Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
IsaacChanghau/ReLoCLNet/utils/basic_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from huangmozhi9527/gmmformer_v2, is pointer only (licence: NONE) · get_code("74637d0535a2a594")
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 huangmozhi9527/gmmformer_v2, 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_temporal_iou Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
IsaacChanghau/ReLoCLNet/utils/temporal_nms.py
code served (permissive licence) · get_code("ea2ba2c075c6b18b")
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 numpy as np

torch.manual_seed(0)

# Based on the function signature and body:
# pred: [st (float), ed (float)] - a list/array with 2 floats representing start and end times
# gt: [st (float), ed (float)] - a list/array with 2 floats representing ground truth start and end times

# The function accesses pred[0], pred[1], gt[0], gt[1] and performs comparisons/arithmetic
# It expects numeric types that support min(), max(), and subtraction

ARGS = {
    "pred": [1.5, 4.2],
    "gt": [2.0, 5.0]
}
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 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
count_parameters Ran
ran, honoured the contract we drafted
IsaacChanghau/ReLoCLNet/utils/model_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Zhuo-Cao/QV-M2, is pointer only (licence: NONE) · get_code("edb929dece68582e")
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 Zhuo-Cao/QV-M2, 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.

get_negative_expectation Ran
ran on a synthesized input
IsaacChanghau/ReLoCLNet/method_tvr/contrastive.py
code served (permissive licence) · get_code("4f45aaa5d5ee3903")
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. 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 math

torch.manual_seed(0)

# Create q_samples - a small tensor with shape (batch_size, features)
# The function uses this tensor in various operations like F.softplus, torch.exp, etc.
q_samples = torch.randn(2, 4)

# Test with different measures to ensure the setup works with all branches
measure = 'JSD'

# average parameter controls whether to return mean or raw values
average = True

ARGS = {
    'q_samples': q_samples,
    'measure': measure,
    'average': average,
}
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
get_positive_expectation Ran
ran on a synthesized input
IsaacChanghau/ReLoCLNet/method_tvr/contrastive.py
code served (permissive licence) · get_code("d71a913407877e0a")
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. 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 math

torch.manual_seed(0)

# Create a small tensor of positive samples
# The function uses this tensor in various operations like softplus, exp, etc.
p_samples = torch.randn(2, 4)

# Ensure samples are in a reasonable range for numerical stability
p_samples = torch.abs(p_samples) + 0.1

# Test with different measures to ensure all paths work
ARGS = {
    'p_samples': p_samples,
    'measure': 'JSD',
    'average': True
}
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
mask_logits Ran
ran, honoured the contract we drafted
IsaacChanghau/ReLoCLNet/method_tvr/model.py
pointer only (licence: MIT); the stored copy get_code serves, from songpipi/amdnet, is pointer only (licence: NONE) · get_code("1c17153fb5488283")
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 songpipi/amdnet, 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.

onehot Ran
ran; our contract draft was wrong, not the code
IsaacChanghau/ReLoCLNet/method_tvr/model_components.py
code served (permissive licence) · get_code("23b5db90923f7386")
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 int, 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)

# Create a small long tensor of indexes
# The function expects a long tensor with arbitrary shape
# Let's create a 2D tensor with shape (2, 3) containing index values
indexes = torch.tensor([[0, 1, 2], [1, 2, 0]], dtype=torch.long)

# N can be None (will be inferred from max index) or an explicit integer
# Let's provide an explicit N value that's larger than the max index
N = 4

ARGS = {
    "indexes": indexes,
    "N": N,
}
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 int, 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
pool_across_time Ran
ran on a synthesized input
IsaacChanghau/ReLoCLNet/utils/model_utils.py
code served (permissive licence) · get_code("286f821a3988fcbe")
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

torch.manual_seed(0)

# Create valid arguments for pool_across_time
B = 2  # batch size
T = 5  # time dimension
D = 4  # feature dimension

# outputs: (B, T, D) - RNN outputs
outputs = torch.randn(B, T, D)

# lengths: (B,) - actual lengths for each sequence in batch
lengths = torch.tensor([3, 4], dtype=torch.long)

# pool_type: str - either 'max' or 'mean'
pool_type = 'max'

ARGS = {
    'outputs': outputs,
    'lengths': lengths,
    'pool_type': pool_type
}
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, 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
prepare_batch_inputs Ran
ran on a synthesized input
IsaacChanghau/ReLoCLNet/method_tvr/start_end_dataset.py
code served (permissive licence) · get_code("493ba890112a446e")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Construct batched_model_inputs dict
# The function expects keys that may contain 'feat', and for those keys,
# the value should be a tuple of (tensor, tensor) where first is the feature
# and second is the mask. Other keys should have tensor values directly.

batched_model_inputs = {
    'feat_embedding': (
        torch.randn(2, 4),  # feature tensor
        torch.randn(2, 4)   # mask tensor
    ),
    'feat_spatial': (
        torch.randn(2, 3),  # feature tensor
        torch.randn(2, 3)   # mask tensor
    ),
    'token_ids': torch.randn(2, 5),  # regular tensor without 'feat'
    'attention': torch.randn(2, 6)   # regular tensor without 'feat'
}

device = 'cpu'
non_blocking = False

ARGS = {
    'batched_model_inputs': batched_model_inputs,
    'device': device,
    'non_blocking': non_blocking
}
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 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
temporal_non_maximum_suppression Ran
ran on a synthesized input
IsaacChanghau/ReLoCLNet/utils/temporal_nms.py
code served (permissive licence) · get_code("d235ed6d33e43a98")
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 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
import numpy as np

# Set random seed for reproducibility
torch.manual_seed(0)

# Define the arguments for temporal_non_maximum_suppression
# predictions: list of sublists, each sublist is [st (float), ed (float), score (float)]
predictions = [
    [1.0, 5.0, 0.9],      # start=1.0, end=5.0, score=0.9
    [2.0, 6.0, 0.8],      # start=2.0, end=6.0, score=0.8
    [10.0, 15.0, 0.85],   # start=10.0, end=15.0, score=0.85
    [11.0, 16.0, 0.7],    # start=11.0, end=16.0, score=0.7
    [20.0, 25.0, 0.75],   # start=20.0, end=25.0, score=0.75
]

nms_threshold = 0.5

max_after_nms = 100

ARGS = {
    "predictions": predictions,
    "nms_threshold": nms_threshold,
    "max_after_nms": max_after_nms,
}
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 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
time_to_index Ran
ran, honoured the contract we drafted
IsaacChanghau/ReLoCLNet/utils/basic_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from huangmozhi9527/gmmformer_v2, is pointer only (licence: NONE) · get_code("65345dbb8096725d")
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 huangmozhi9527/gmmformer_v2, 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.

uniform_feature_sampling Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
IsaacChanghau/ReLoCLNet/utils/basic_utils.py
pointer only (licence: MIT); the stored copy get_code serves, from huangmozhi9527/gmmformer_v2, is pointer only (licence: NONE) · get_code("2429bc2313c0669b")
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 huangmozhi9527/gmmformer_v2, 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.

get_proposal_interface Not yet run
unverified (harvested, no recorded run)
IsaacChanghau/ReLoCLNet/method_tvr/proposal.py
code served (permissive licence) · get_code("381069cbe9170bdd")
How it ran

no invocation recorded.

log_sum_exp Not yet run
unverified (harvested, no recorded run)
IsaacChanghau/ReLoCLNet/method_tvr/contrastive.py
code served (permissive licence) · get_code("80b5572ac3d22dd3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 10 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 4 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
mask_logits 13 other papers
3 dated earlier, 10 later · 1 only as an assembly brick
1904.11574 (2019-04)
TVQA+: Spatio-Temporal Grounding for Video Question Answering
2001.09099 (2020-01)
TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval
2005.06409 (2020-05)
Dense-Caption Matching and Frame-Selection Gating for Temporal Localization in VideoQA
and 10 more not named here
count_parameters 11 other papers
1 dated earlier, 10 later
2001.09099 (2020-01)
TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval
2207.00383 (2022-07)
ReLER@ZJU-Alibaba Submission to the Ego4D Natural Language Queries Challenge 2022
2301.00746 (2023-01)
NaQ: Leveraging Narrations as Queries to Supervise Episodic Memory
and 8 more not named here
compute_temporal_iou 5 other papers
2 dated earlier, 3 later
1904.11574 (2019-04)
TVQA+: Spatio-Temporal Grounding for Video Question Answering
2001.09099 (2020-01)
TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval
2306.15255 (2023-06)
GroundNLQ @ Ego4D Natural Language Queries Challenge 2023
and 2 more not named here
compute_overlap 2 other papers
2 later
2312.06505 (2023-12)
Grounded Question-Answering in Long Egocentric Videos
2405.13824 (2024-05)
GMMFormer v2: An Uncertainty-aware Framework for Partially Relevant Video Retrieval
log_sum_exp 2 other papers
1 dated earlier, 1 later
2010.04592 (2020-10)
Contrastive Learning with Hard Negative Samples
2402.16302 (2024-02)
Graph Diffusion Policy Optimization
onehot 2 other papers
2 later
2310.05195 (2023-10)
GMMFormer: Gaussian-Mixture-Model Based Transformer for Efficient Partially Relevant Video Retrieval
2507.17402 (2025-07)
Enhancing Partially Relevant Video Retrieval with Hyperbolic Learning
pool_across_time 1 other paper
1 dated earlier
2001.09099 (2020-01)
TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval
temporal_non_maximum_suppression 1 other paper
1 dated earlier
2001.09099 (2020-01)
TVR: A Large-Scale Dataset for Video-Subtitle Moment Retrieval
time_to_index 1 other paper
1 later
2405.13824 (2024-05)
GMMFormer v2: An Uncertainty-aware Framework for Partially Relevant Video Retrieval
uniform_feature_sampling 1 other paper
1 later
2405.13824 (2024-05)
GMMFormer v2: An Uncertainty-aware Framework for Partially Relevant Video 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

Given a collection of untrimmed and unsegmented videos, video corpus moment retrieval (VCMR) is to retrieve a temporal moment (i.e., a fraction of a video) that semantically corresponds to a given text query. As video and text are from two distinct feature spaces, there are two general approaches to address VCMR: (i) to separately encode each modality representations, then align the two modality representations for query processing, and (ii) to adopt fine-grained cross-modal interaction to learn multi-modal representations for query processing. While the second approach often leads to better retrieval accuracy, the first approach is far more efficient. In this paper, we propose a Retrieval and Localization Network with Contrastive Learning (ReLoCLNet) for VCMR. We adopt the first approach and introduce two contrastive learning objectives to refine video encoder and text encoder to learn video and text representations separately but with better alignment for VCMR. The video contrastive learning (VideoCL) is to maximize mutual information between query and candidate video at video-level. The frame contrastive learning (FrameCL) aims to highlight the moment region corresponds to the query at frame-level, within a video. Experimental results show that, although ReLoCLNet encodes text and video separately for efficiency, its retrieval accuracy is comparable with baselines adopting cross-modal interaction learning.

For agents

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

get_harvested_code_for_paper("2105.06247")
get_code_for_paper("2105.06247")
have("2105.06247")

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

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

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

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

Connect an agent — have() is free.