SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.01990 · 2019

Invariance Matters: Exemplar Memory for Domain Adaptive Person Re-identification

arXiv · PDF · Open in the Atlas

Code that ran

4 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; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/1904.01990.json · badge: /api/ran/1904.01990.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
zhunzhong07/ECN canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
center_crop Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhunzhong07/ECN/reid/lib/custom_transforms.py
code served (permissive licence) · get_code("693513ff2d202308")
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 float, shape (2, 2, 0) 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 expects:
# - x: a 3D tensor with shape (batch, height, width)
# - center_crop_size: a tuple or list of (crop_height, crop_width)

# Create a small 3D tensor: batch=2, height=4, width=3
x = torch.randn(2, 4, 3)

# Create center_crop_size with smaller dimensions than x
# so the crop is valid (must be smaller than x dimensions)
center_crop_size = (2, 1)

ARGS = {
    "x": x,
    "center_crop_size": center_crop_size,
}
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 float, shape (2, 2, 0) — shape (2, 2, 0) 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
pairwise_distance Ran
ran on a synthesized input
zhunzhong07/ECN/reid/evaluators.py
code served (permissive licence) · get_code("3d333344e0965776")
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
import numpy as np

torch.manual_seed(0)

# The function expects query_features and gallery_features to be dicts
# where keys map to tensors. query and gallery are lists of tuples
# where each tuple has at least 3 elements (accessed as f, _, _)

# Create small feature tensors
query_features = {
    'id_0': torch.randn(4),  # 4-dim feature vector
    'id_1': torch.randn(4),
}

gallery_features = {
    'id_2': torch.randn(4),  # 4-dim feature vector
    'id_3': torch.randn(4),
    'id_4': torch.randn(4),
}

# Create query list: each element is a tuple (file_id, unused, unused)
query = [
    ('id_0', None, None),
    ('id_1', None, None),
]

# Create gallery list: each element is a tuple (file_id, unused, unused)
gallery = [
    ('id_2', None, None),
    ('id_3', None, None),
    ('id_4', None, None),
]

ARGS = {
    'query_features': query_features,
    'gallery_features': gallery_features,
    'query': query,
    'gallery': gallery,
}
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 (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
random_num_generator Ran
ran, honoured the contract we drafted
zhunzhong07/ECN/reid/lib/custom_transforms.py
code served (permissive licence) · get_code("abf95b2d2f20e322")
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 float64, ndim 0, 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

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

# Create a valid config for 'uniform' distribution
config_uniform = ['uniform', 0.5, 1.5]

# Create the ARGS dictionary with all required parameters
ARGS = {
    'config': config_uniform,
    'random_state': np.random
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
to_tensor Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zhunzhong07/ECN/reid/lib/custom_transforms.py
code served (permissive licence) · get_code("382714b2c227ba48")
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 float, shape (2, 4, 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
import numpy as np

torch.manual_seed(0)

# The function expects x to be a numpy array with shape (H, W, C)
# It will transpose to (C, H, W) and convert to torch tensor
x = np.random.randn(4, 3, 2).astype(np.float32)

ARGS = {
    "x": x
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 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
accuracy Not yet run
unverified (harvested, no recorded run)
zhunzhong07/ECN/reid/evaluation_metrics/classification.py
code served (permissive licence) · get_code("302abe91718126bb")
How it ran

no invocation recorded.

cmc Not yet run
unverified (harvested, no recorded run)
zhunzhong07/ECN/reid/evaluation_metrics/ranking.py
code served (permissive licence) · get_code("b39a10404aa7ed0b")
How it ran

no invocation recorded.

extract_cnn_feature Not yet run
unverified (harvested, no recorded run)
zhunzhong07/ECN/reid/evaluators.py
code served (permissive licence) · get_code("f0f55d269b048d70")
How it ran

no invocation recorded.

extract_features Not yet run
unverified (harvested, no recorded run)
zhunzhong07/ECN/reid/evaluators.py
code served (permissive licence) · get_code("a4eea4bd3cfe2026")
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, 5 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 2 the same month, 3 later) and 3 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
center_crop 2 other papers
2 later
2008.03813 (2020-08)
Unsupervised Feature Learning by Cross-Level Instance-Group Discrimination
2105.01289 (2021-05)
Representation Learning for Clustering via Building Consensus
random_num_generator 2 other papers
2 later
2008.03813 (2020-08)
Unsupervised Feature Learning by Cross-Level Instance-Group Discrimination
2105.01289 (2021-05)
Representation Learning for Clustering via Building Consensus
to_tensor 2 other papers
2 later
2008.03813 (2020-08)
Unsupervised Feature Learning by Cross-Level Instance-Group Discrimination
2105.01289 (2021-05)
Representation Learning for Clustering via Building Consensus
accuracy 1 other paper
1 the same month
1904.02998 (2019-04)
Relation-Aware Global Attention for Person Re-identification
cmc 1 other paper
1 the same month
1904.02998 (2019-04)
Relation-Aware Global Attention for Person Re-identification

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-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

This paper considers the domain adaptive person re-identification (re-ID) problem: learning a re-ID model from a labeled source domain and an unlabeled target domain. Conventional methods are mainly to reduce feature distribution gap between the source and target domains. However, these studies largely neglect the intra-domain variations in the target domain, which contain critical factors influencing the testing performance on the target domain. In this work, we comprehensively investigate into the intra-domain variations of the target domain and propose to generalize the re-ID model w.r.t three types of the underlying invariance, i.e., exemplar-invariance, camera-invariance and neighborhood-invariance. To achieve this goal, an exemplar memory is introduced to store features of the target domain and accommodate the three invariance properties. The memory allows us to enforce the invariance constraints over global training batch without significantly increasing computation cost. Experiment demonstrates that the three invariance properties and the proposed memory are indispensable towards an effective domain adaptation system. Results on three re-ID domains show that our domain adaptation accuracy outperforms the state of the art by a large margin. Code is available at: https://github.com/zhunzhong07/ECN

For agents

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

get_harvested_code_for_paper("1904.01990")
get_code_for_paper("1904.01990")
have("1904.01990")

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

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

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

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

Connect an agent — have() is free.