SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_20163 · AAAI · 2022

Negative Sample Matters: A Renaissance of Metric Learning for Temporal Grounding

Limin Wang, Zhenzhi Wang, Gangshan Wu, Tianhao Li, Tao Wu

Code that ran

7 of 9 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 5 have no contract verdict; 2 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/aaai_20163.json · badge: /api/ran/aaai_20163.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
MCG-NJU/MMN canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
build_bce_loss Ran
ran on a synthesized input
MCG-NJU/MMN/mmn/modeling/mmn/loss.py
code served (permissive licence) · get_code("5b3fff383f83fd56")
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 BceLoss. 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)

# Create a minimal config class that has the nested attributes needed
class MinimalConfig:
    def __init__(self):
        self.MODEL = type('obj', (object,), {})()
        self.MODEL.MMN = type('obj', (object,), {})()
        self.MODEL.MMN.LOSS = type('obj', (object,), {})()
        self.MODEL.MMN.LOSS.MIN_IOU = 0.3
        self.MODEL.MMN.LOSS.MAX_IOU = 0.9

cfg = MinimalConfig()

# Create a 2D mask tensor - batch_size=2, spatial_dims=4
# The mask determines which elements to select via masked_select
mask2d = torch.tensor([
    [True, False, True, False],
    [False, True, False, True]
])

ARGS = {
    "cfg": cfg,
    "mask2d": mask2d
}
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 BceLoss — a BceLoss output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BceLoss 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
build_feat2d Ran
ran on a synthesized input
MCG-NJU/MMN/mmn/modeling/mmn/feat2d.py
code served (permissive licence) · get_code("98100e72089961a2")
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 SparseMaxPool. 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 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 import nn

torch.manual_seed(0)

class MockConfig:
    def __init__(self):
        self.MODEL = type('obj', (object,), {
            'MMN': type('obj', (object,), {
                'FEAT2D': type('obj', (object,), {
                    'POOLING_COUNTS': [2, 1],
                    'NAME': 'pool'
                })(),
                'NUM_CLIPS': 8,
                'FEATPOOL': type('obj', (object,), {
                    'HIDDEN_SIZE': 4
                })()
            })()
        })()

ARGS = {
    'cfg': MockConfig()
}
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 SparseMaxPool — a SparseMaxPool output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SparseMaxPool 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
build_featpool Ran
ran on a synthesized input
MCG-NJU/MMN/mmn/modeling/mmn/featpool.py
code served (permissive licence) · get_code("76d06ee8ef4b1fc6")
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 FeatAvgPool. 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 MockConfig:
    def __init__(self):
        self.MODEL = type('obj', (object,), {
            'MMN': type('obj', (object,), {
                'FEATPOOL': type('obj', (object,), {
                    'INPUT_SIZE': 5,
                    'HIDDEN_SIZE': 8,
                    'KERNEL_SIZE': 3,
                })(),
                'NUM_CLIPS': 4,
            })(),
        })()
        self.INPUT = type('obj', (object,), {
            'NUM_PRE_CLIPS': 16,
        })()

cfg = MockConfig()

ARGS = {
    'cfg': cfg,
}
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 FeatAvgPool — a FeatAvgPool output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FeatAvgPool 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
build_proposal_conv Ran
ran on a synthesized input
MCG-NJU/MMN/mmn/modeling/mmn/proposal_conv.py
code served (permissive licence) · get_code("9859ae93e3e487cb")
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 ProposalConv. 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 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 import nn

torch.manual_seed(0)

class MockConfig:
    def __init__(self):
        self.MODEL = MockModel()
        self.DATASETS = MockDatasets()

class MockModel:
    def __init__(self):
        self.MMN = MockMMN()

class MockMMN:
    def __init__(self):
        self.FEATPOOL = MockFeatpool()
        self.PREDICTOR = MockPredictor()

class MockFeatpool:
    def __init__(self):
        self.HIDDEN_SIZE = 4

class MockPredictor:
    def __init__(self):
        self.HIDDEN_SIZE = 8
        self.KERNEL_SIZE = 3
        self.NUM_STACK_LAYERS = 2

class MockDatasets:
    def __init__(self):
        self.NAME = "test_dataset"

cfg = MockConfig()
cfg.MODEL.MMN.JOINT_SPACE_SIZE = 5

mask2d = torch.ones(16, 16, dtype=torch.bool)

ARGS = {
    "cfg": cfg,
    "mask2d": mask2d,
}
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 ProposalConv — a ProposalConv output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ProposalConv 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_padded_mask_and_weight Ran
ran; our contract draft was wrong, not the code
MCG-NJU/MMN/mmn/modeling/mmn/proposal_conv.py
code served (permissive licence) · get_code("66028d6c31d2d0d1")
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, ndim 5, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a small Conv2d module
# The function accesses: conv.kernel_size, conv.stride, conv.padding, conv.dilation
conv = nn.Conv2d(in_channels=1, out_channels=1, kernel_size=(3, 3), stride=1, padding=1, dilation=1)

# Create a small mask tensor
# mask needs to be compatible with F.conv2d operation
# Shape: (batch, channels, height, width)
mask = torch.ones(2, 1, 4, 4)

ARGS = {
    'mask': mask,
    'conv': conv
}
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, ndim 5, dtype family float — a tuple 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
mask2weight Ran
ran on a synthesized input
MCG-NJU/MMN/mmn/modeling/mmn/proposal_conv.py
code served (permissive licence) · get_code("bbe0b53f4d2f5d80")
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, 1) 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small 2D mask
mask2d = torch.randint(0, 2, (4, 3)).float()

# Create a small convolution kernel
# The kernel needs to be 4D: (out_channels, in_channels, height, width)
mask_kernel = torch.randn(1, 1, 3, 3)

# Create the arguments dictionary
ARGS = {
    "mask2d": mask2d,
    "mask_kernel": mask_kernel,
    "padding": 0
}
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, 1) — shape (2, 1) 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
strip_prefix_if_present Ran
ran; our contract draft was wrong, not the code
MCG-NJU/MMN/mmn/utils/model_serialization.py
pointer only (licence: MIT); the stored copy get_code serves, from BIT-DA/SDCA, is pointer only (licence: NONE) · get_code("5a951495ac113177")
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 BIT-DA/SDCA, 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.

build_text_encoder Not yet run
unverified (harvested, no recorded run)
MCG-NJU/MMN/mmn/modeling/mmn/text_encoder.py
code served (permissive licence) · get_code("8afbb83c0adfe917")
How it ran

no invocation recorded.

compute_on_dataset Not yet run
unverified (harvested, no recorded run)
MCG-NJU/MMN/mmn/engine/inference.py
code served (permissive licence) · get_code("f231f7c01637350e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 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
strip_prefix_if_present 14 other papers
3 dated earlier, 6 later, 5 same year, order not determinable
2002.10111 (2020-02)
SMOKE: Single-Stage Monocular 3D Object Detection via Keypoint Estimation
2104.02323 (2021-04)
Objects are Different: Flexible Monocular 3D Object Detection
2105.05013 (2021-05)
Semantic Distribution-aware Contrastive Adaptation for Semantic Segmentation
and 11 more not named here
get_padded_mask_and_weight 1 other paper
1 later
2308.04197 (2023-08)
D3G: Exploring Gaussian Prior for Temporal Sentence Grounding with Glance Annotation

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

Temporal grounding aims to localize a video moment which is semantically aligned with a given natural language query. Existing methods typically apply a detection or regression pipeline on the fused representation with the research focus on designing complicated prediction heads or fusion strategies. Instead, from a perspective on temporal grounding as a metric-learning problem, we present a Mutual Matching Network (MMN), to directly model the similarity between language queries and video moments in a joint embedding space. This new metric-learning framework enables fully exploiting negative samples from two new aspects: constructing negative cross-modal pairs in a mutual matching scheme and mining negative pairs across different videos. These new negative samples could enhance the joint representation learning of two modalities via cross-modal mutual matching to maximize their mutual information. Experiments show that our MMN achieves highly competitive performance compared with the state-of-the-art methods on four video grounding benchmarks. Based on MMN, we present a winner solution for the HC-STVG challenge of the 3rd PIC workshop. This suggests that metric learning is still a promising method for temporal grounding via capturing the essential cross-modal correlation in a joint embedding space. Code is available at https://github.com/MCG-NJU/MMN.

For agents

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

get_harvested_code_for_paper("aaai_20163")
get_code_for_paper("aaai_20163")
have("aaai_20163")

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

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

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

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

Connect an agent — have() is free.