SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1911.05722 · CVPR · 2019

Momentum Contrast for Unsupervised Visual Representation Learning

Kaiming He, Saining Xie, Ross Girshick, Yuxin Wu, Haoqi Fan

arXiv · PDF · Open in the Atlas

Code that ran

28 of 42 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (16 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 21 have no contract verdict; 7 failures of our instrument; 14 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/1911.05722.json · badge: /api/ran/1911.05722.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
HobbitLong/CMC canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
lightly-ai/lightly community
Papers with Code archive
2 ran · 4 no recorded run
HobbitLong/PyContrast community
not in the paper's declared repositories
2 ran · 0 no recorded run
Pangoraw/GeoSSL community
not in the paper's declared repositories
2 ran · 0 no recorded run
giakou4/pyssl community
not in the paper's declared repositories
2 ran · 0 no recorded run
amazon-research/exponential-moving-average-normalization community
Papers with Code archive
2 ran · 0 no recorded run
KevinMusgrave/pytorch_metric_learning community
Papers with Code archive
1 ran · 2 no recorded run
AidenDurrant/MoCo-Pytorch community
Papers with Code archive
1 ran · 1 no recorded run
ehsanik/muscleTorch community
Papers with Code archive
1 ran · 0 no recorded run
bl0/moco community
Papers with Code archive
1 ran · 0 no recorded run
szq0214/CMC_with_Image_Mixture community
not in the paper's declared repositories
1 ran · 0 no recorded run
joshr17/IFM community
Papers with Code archive
1 ran · 0 no recorded run
1170500804/MoCo community
Papers with Code archive
1 ran · 0 no recorded run
davidsvy/hard-negative-mixing community
Papers with Code archive
1 ran · 0 no recorded run
AndrewTal/MoCo-Pytorch community
Papers with Code archive
1 ran · 0 no recorded run
kikacaty/adv_guide community
Papers with Code archive
1 ran · 0 no recorded run
zhangyifei01/EIR community
not in the paper's declared repositories
1 ran · 0 no recorded run
leftthomas/moco community
Papers with Code archive
1 ran · 0 no recorded run
trannhiem/ma_ssrl_pytorch community
not in the paper's declared repositories
1 ran · 0 no recorded run
beresandras/contrastive-classification-keras community
Papers with Code archive
0 ran · 2 no recorded run
linwenye/light-moco community
Papers with Code archive
0 ran · 1 no recorded run
xiangli13/MoCo community
not in the paper's declared repositories
0 ran · 1 no recorded run
Evgeneus/MoCo community
Papers with Code archive
0 ran · 1 no recorded run
giakoumoglou/synco community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
BaseMoCo Ran
ran on a synthesized input · constructed an object; no result was computed
HobbitLong/PyContrast/pycontrast/memory/mem_moco.py
pointer only (licence: NONE) · get_code("844eb6ac74b615e9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HobbitLong/PyContrast 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.

CosineMomentumScheduler Ran
ran on a synthesized input · constructed an object; no result was computed
Pangoraw/GeoSSL/geossl/moco.py
code served (permissive licence) · get_code("bd4622df07c12c27")
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 an instance of its own class, CosineMomentumScheduler: the run constructed the object and did not call it, so no result was computed. 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 math

ARGS = {
    'base_momentum': 0.95,
    'final_momentum': 0.99,
    'n_steps': 100
}
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 CosineMomentumScheduler — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CosineMomentumScheduler 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
MemoryMoCo Ran
ran on a synthesized input · constructed an object; no result was computed
ehsanik/muscleTorch/utils/contrastive_utils.py
pointer only (licence: NONE) · get_code("587d6926bc87730f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ehsanik/muscleTorch 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.

MemoryMoCo Ran
ran on a synthesized input
bl0/moco/moco/NCE/Contrast.py
pointer only (licence: NONE) · get_code("dfdbae86713f4677")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, bl0/moco 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.

MemoryMoCo Ran
ran on a synthesized input
szq0214/CMC_with_Image_Mixture/NCE/NCEAverage.py
pointer only (licence: NONE) · get_code("1b18a48a2e94a2b4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, szq0214/CMC_with_Image_Mixture 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.

MoCo Ran
ran on a synthesized input · constructed an object; no result was computed
giakou4/pyssl/builders/moco.py
code served (permissive licence) · get_code("82980b2ad9007485")
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 an instance of its own class, MoCo: the run constructed the object and did not call it, so no result was computed. 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create a minimal backbone that outputs feature_size=16
class SimpleBackbone(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 8, kernel_size=3, padding=1)
        self.pool = nn.AdaptiveAvgPool2d((1, 1))
        self.fc = nn.Linear(8, 16)
    
    def forward(self, x):
        x = self.conv(x)
        x = self.pool(x)
        x = x.view(x.size(0), -1)
        x = self.fc(x)
        return x

backbone = SimpleBackbone()

ARGS = {
    'backbone': backbone,
    'feature_size': 16,
    'projection_dim': 128,
    'K': 65536,
    'm': 0.999,
    'temperature': 0.07,
    'image_size': 224,
    'mean': (0.5,),
    'std': (0.229, 0.224, 0.225)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MoCo — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MoCo 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
MoCo Ran
ran on a synthesized input · constructed an object; no result was computed
joshr17/IFM/moco-master/moco/builder.py
code served (permissive licence) · get_code("a92f8d3efcd0fa73")
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 an instance of its own class, MoCo: the run constructed the object and did not call it, so no result was computed. 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
import torch.nn as nn

# Create a minimal base encoder that satisfies the requirements
class MinimalEncoder(nn.Module):
    def __init__(self, num_classes=128):
        super(MinimalEncoder, self).__init__()
        self.conv1 = nn.Conv2d(3, 8, kernel_size=3, padding=1)
        self.fc = nn.Linear(8, num_classes)
    
    def forward(self, x):
        x = self.conv1(x)
        x = x.view(x.size(0), -1)
        x = self.fc(x)
        return x

torch.manual_seed(0)

ARGS = {
    'base_encoder': MinimalEncoder,
    'dim': 128,
    'K': 256,
    'm': 0.999,
    'T': 0.07,
    'mlp': 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 MoCo — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MoCo 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
MoCo Ran
ran on a synthesized input · constructed an object; no result was computed
amazon-research/exponential-moving-average-normalization/models/moco.py
pointer only (licence: NONE) · get_code("60e7c290602e7d6a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, amazon-research/exponential-moving-average-normalization 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.

MoCo Ran
ran on a synthesized input · constructed an object; no result was computed
1170500804/MoCo/moco/builder.py
pointer only (licence: NOASSERTION) · get_code("1f9e6eca512e3008")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, 1170500804/MoCo (NOASSERTION). 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.

MoCo Ran
ran on a synthesized input · constructed an object; no result was computed
davidsvy/hard-negative-mixing/src/moco.py
code served (permissive licence) · get_code("d0fb06c245f652b9")
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 an instance of its own class, MoCo: the run constructed the object and did not call it, so no result was computed. 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
import torch.nn.functional as F
import copy

torch.manual_seed(0)

# Create a minimal encoder that satisfies the requirements
class SimpleEncoder(nn.Module):
    def __init__(self, input_dim=3, output_dim=4):
        super(SimpleEncoder, self).__init__()
        self.fc = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.fc(x)

# Build the encoder
encoder = SimpleEncoder(input_dim=3, output_dim=4)

# Define ARGS dictionary with all parameters for MoCo.__init__
ARGS = {
    'encoder': encoder,
    'dim': 4,
    'K': 16,
    'm': 0.999,
    'T': 0.07,
    'n_hard': 4,
    's1_hard': 2,
    's2_hard': 2,
    'start1_hard': 8,
    'start2_hard': 12,
}
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 MoCo — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MoCo 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
MoCo Ran
ran on a synthesized input · constructed an object; no result was computed
AndrewTal/MoCo-Pytorch/moco/builder.py
pointer only (licence: NONE) · get_code("d568cb5387bc22f3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AndrewTal/MoCo-Pytorch 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.

MoCo Ran
ran on a synthesized input · constructed an object; no result was computed
kikacaty/adv_guide/moco/builder.py
pointer only (licence: NOASSERTION) · get_code("ce8d71b82b20b145")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, kikacaty/adv_guide (NOASSERTION). 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.

MoCo Ran
ran on a synthesized input · constructed an object; no result was computed
Pangoraw/GeoSSL/geossl/moco.py
code served (permissive licence) · get_code("54ef0c846a171c93")
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 an instance of its own class, MoCo: the run constructed the object and did not call it, so no result was computed. 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
import math

torch.manual_seed(0)

class ResNetBackbone(nn.Module):
    def __init__(self, out_dim: int = 4):
        super().__init__()
        self.out_dim = out_dim
        self.fc = nn.Linear(3, out_dim)
    
    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.fc(x)

encoder_s = ResNetBackbone(out_dim=4)
encoder_t = ResNetBackbone(out_dim=4)

ARGS = {
    'encoder_s': encoder_s,
    'encoder_t': encoder_t,
    'feat_dim': 5,
    'base_momentum': 0.99,
    'final_momentum': 0.999,
    'n_steps': 100,
    'queue_size': 16,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MoCo — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MoCo 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
MoCo Ran
ran on a synthesized input · constructed an object; no result was computed
zhangyifei01/EIR/moco/builder.py
code served (permissive licence) · get_code("6e34a9f59a466d7f")
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 an instance of its own class, MoCo: the run constructed the object and did not call it, so no result was computed. 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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

class SimpleEncoder(nn.Module):
    """Minimal encoder that satisfies MoCo's usage"""
    def __init__(self, num_classes=128):
        super().__init__()
        self.conv = nn.Conv2d(3, 8, kernel_size=3, padding=1)
        self.pool = nn.AdaptiveAvgPool2d((1, 1))
        self.fc = nn.Linear(8, num_classes)
    
    def forward(self, x):
        x = self.conv(x)
        x = self.pool(x)
        x = x.view(x.size(0), -1)
        x = self.fc(x)
        return x

base_encoder = SimpleEncoder

ARGS = {
    'base_encoder': base_encoder,
    'dim': 128,
    'K': 256,
    'm': 0.999,
    'T': 0.07,
    'TT': 0.04,
    'ST': 0.1,
    'mlp': False
}
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 MoCo — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MoCo 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
MoCoProjectionHead Ran
ran on a synthesized input
lightly-ai/lightly/lightly/models/moco.py
code served (permissive licence) · get_code("f0d8899a1cadcb6a")
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 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 torch.nn as nn

INIT_ARGS = {
    'input_dim': 4,
    'hidden_dim': 8,
    'output_dim': 3,
    'num_layers': 2,
    'batch_norm': False,
}

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

if __name__ == '__main__':
    from __main__ import ProjectionHead, MoCoProjectionHead
    
    model = MoCoProjectionHead(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: (2, 3)")
    assert output.shape == (2, 3), f"Shape mismatch: {output.shape} != (2, 3)"
    print("Test passed!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
__main__, 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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)
Model Ran
ran on a synthesized input
leftthomas/moco/model.py
pointer only (licence: NONE) · get_code("2e32520281111228")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, leftthomas/moco 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.

ModuleWithRecords Ran
ran on a synthesized input · constructed an object; no result was computed
KevinMusgrave/pytorch_metric_learning/src/pytorch_metric_learning/losses/cross_batch_memory.py
code served (permissive licence) · get_code("5bf7745f1e480d55")
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 an instance of its own class, ModuleWithRecords: the run constructed the object and did not call it, so no result was computed. 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

# Create a minimal stand-in for c_f module functions
class c_f:
    COLLECT_STATS = True
    
    @staticmethod
    def add_to_recordable_attributes(module, name=None, list_of_names=None, is_stat=False):
        if not hasattr(module, 'recordable_attributes'):
            module.recordable_attributes = []
        if name:
            module.recordable_attributes.append(name)
        if list_of_names:
            module.recordable_attributes.extend(list_of_names)
    
    @staticmethod
    def reset_stats(module):
        if hasattr(module, 'stats'):
            module.stats = {}

torch.manual_seed(0)

ARGS = {
    "collect_stats": 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 ModuleWithRecords — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ModuleWithRecords 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
MomentumUpdater Ran
ran on a synthesized input · constructed an object; no result was computed
trannhiem/ma_ssrl_pytorch/MA_SSRL/utils/momentum.py
pointer only (licence: NOASSERTION) · get_code("d57c8e5463db2477")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, trannhiem/ma_ssrl_pytorch (NOASSERTION). 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.

ProjectionHead Ran
ran on a synthesized input
lightly-ai/lightly/lightly/models/moco.py
code served (permissive licence) · get_code("d76bde76567cd6c0")
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 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 torch.nn as nn

# Define the blocks for the projection head
# Each block: (in_features, out_features, batch_norm_layer, non_linearity_layer, use_bias (optional))
blocks = [
    (8, 6, nn.BatchNorm1d(6), nn.ReLU()),
    (6, 4, None, nn.Tanh(), True),
    (4, 3, None, None)
]

INIT_ARGS = {
    "blocks": blocks
}

# Create input tensor with batch size 2 and input features 8 (matching first block's in_features)
x = torch.randn(2, 8)

ARGS = {
    "x": x
}
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 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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)
RGBMoCo Ran
ran on a synthesized input · constructed an object; no result was computed
HobbitLong/PyContrast/pycontrast/memory/mem_moco.py
pointer only (licence: NONE) · get_code("205d8773b717c4eb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, HobbitLong/PyContrast 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_hidden_head Ran
ran; our contract draft was wrong, not the code
amazon-research/exponential-moving-average-normalization/models/moco.py
pointer only (licence: NONE) · get_code("3ce0bcff10714b54")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, amazon-research/exponential-moving-average-normalization 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.

conv3x3 Ran
ran; our contract draft was wrong, not the code
HobbitLong/CMC/models/resnet.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from lixiaotong97/DSU, 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_shuffle_ids Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HobbitLong/CMC/train_moco_ins.py
code served (permissive licence) · get_code("e2e91e39d8368ced")
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 tuple, ndim 2, dtype family int; 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

torch.manual_seed(0)

# The function get_shuffle_ids takes a batch size (bsz) as input
# and generates shuffle indices for ShuffleBN operations.
# It requires an integer batch size parameter.

bsz = 2

ARGS = {
    "bsz": bsz
}
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 tuple, ndim 2, dtype family int — 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
infonce_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
giakou4/pyssl/builders/moco.py
code served (permissive licence) · get_code("5cd3d9e4fc246bdf")
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 torch.nn.functional as F

torch.manual_seed(0)

# The function expects:
# - q: query tensor (batch_size, embedding_dim)
# - k: key tensor (batch_size, embedding_dim)
# - queue: queue tensor (embedding_dim, queue_size)
# - temperature: float scalar

batch_size = 2
embedding_dim = 4
queue_size = 3

# Create query tensor
q = torch.randn(batch_size, embedding_dim)

# Create key tensor
k = torch.randn(batch_size, embedding_dim)

# Create queue tensor (embedding_dim x queue_size)
queue = torch.randn(embedding_dim, queue_size)

# Temperature parameter
temperature = 0.07

ARGS = {
    'q': q,
    'k': k,
    'queue': queue,
    'temperature': temperature
}
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
projection_MLP Ran
ran on a synthesized input · constructed an object; no result was computed
AidenDurrant/MoCo-Pytorch/src/model/moco.py
pointer only (licence: NONE) · get_code("dc6a714ff10ed3d9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AidenDurrant/MoCo-Pytorch 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.

resnet18 Ran
ran; our contract draft was wrong, not the code
HobbitLong/CMC/models/resnet.py
code served (permissive licence) · get_code("e56061351deca46f")
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 ResNet. 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
import math

torch.manual_seed(0)

ARGS = {
    'pretrained': False,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
resnet34 Ran
ran; our contract draft was wrong, not the code
HobbitLong/CMC/models/resnet.py
code served (permissive licence) · get_code("f3aafd1c32c0381c")
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 ResNet. 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
import math

torch.manual_seed(0)

ARGS = {
    'pretrained': False,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
set_optimizer Ran
ran; our contract draft was wrong, not the code
HobbitLong/CMC/LinearProbing.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from jiangmengli/metaug, is pointer only (licence: NONE) · get_code("3267a33f67aebf53")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from jiangmengli/metaug, 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.

BaseLossWrapper Not yet run
unverified (harvested, no recorded run)
KevinMusgrave/pytorch_metric_learning/src/pytorch_metric_learning/losses/cross_batch_memory.py
code served (permissive licence) · get_code("3576e4fdf9ea3c2e")
How it ran

no invocation recorded.

CrossBatchMemory Not yet run
unverified (harvested, no recorded run)
KevinMusgrave/pytorch_metric_learning/src/pytorch_metric_learning/losses/cross_batch_memory.py
code served (permissive licence) · get_code("f5b8b2ab5c47caa7")
How it ran

no invocation recorded.

MoCo Not yet run
unverified (harvested, no recorded run)
linwenye/light-moco/moco/builder.py
pointer only (licence: NOASSERTION) · get_code("c605eb4989b100b9")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, linwenye/light-moco (NOASSERTION). 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. No invocation recorded.

MoCo Not yet run
unverified (harvested, no recorded run)
beresandras/contrastive-classification-keras/algorithms.py
code served (permissive licence) · get_code("1318e70df1366b7a")
How it ran

no invocation recorded.

MoCo Not yet run
unverified (harvested, no recorded run)
lightly-ai/lightly/lightly/models/moco.py
code served (permissive licence) · get_code("05ac8df2dc56ea0e")
How it ran

no invocation recorded.

MoCo Not yet run
unverified (harvested, no recorded run)
xiangli13/MoCo/MoCo.py
code served (permissive licence) · get_code("766dfd5385bfa150")
How it ran

no invocation recorded.

MoCo Not yet run
unverified (harvested, no recorded run)
Evgeneus/MoCo/moco/builder.py
pointer only (licence: NOASSERTION) · get_code("88df9e4db87f31e3")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, Evgeneus/MoCo (NOASSERTION). 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. No invocation recorded.

MoCo_Model Not yet run
unverified (harvested, no recorded run)
AidenDurrant/MoCo-Pytorch/src/model/moco.py
pointer only (licence: NONE) · get_code("a70f3f9f550eb5c4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, AidenDurrant/MoCo-Pytorch 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. No invocation recorded.

MomentumContrastiveModel Not yet run
unverified (harvested, no recorded run)
beresandras/contrastive-classification-keras/algorithms.py
code served (permissive licence) · get_code("521294b5f41beba8")
How it ran

no invocation recorded.

SynCo Not yet run
unverified (harvested, no recorded run)
giakoumoglou/synco/synco/builder.py
code served (permissive licence) · get_code("1fb0a31e12db1fbd")
How it ran

no invocation recorded.

_MomentumEncoderMixin Not yet run
unverified (harvested, no recorded run)
lightly-ai/lightly/lightly/models/moco.py
code served (permissive licence) · get_code("40e7ae5bffc7ea30")
How it ran

no invocation recorded.

_deactivate_requires_grad Not yet run
unverified (harvested, no recorded run)
lightly-ai/lightly/lightly/models/moco.py
code served (permissive licence) · get_code("914a6024d62fcd9a")
How it ran

no invocation recorded.

_do_momentum_update Not yet run
unverified (harvested, no recorded run)
lightly-ai/lightly/lightly/models/moco.py
code served (permissive licence) · get_code("a44f04114cc14792")
How it ran

no invocation recorded.

accuracy Not yet run
unverified (harvested, no recorded run)
HobbitLong/CMC/eval_moco_ins.py
pointer only (licence: BSD-2-Clause); the stored copy get_code serves, from boone891214/MEST, is pointer only (licence: NONE) · get_code("913d82af53065418")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-2-Clause), but get_code serves the stored copy, first harvested from boone891214/MEST, 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. No invocation recorded.

Also present in other papers' code

Of 42 samples lifted from this paper's linked repositories, 42 carry a function identity and 0 do not. Of the 42 distinct functions with an identity, 7 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 4 the same month, 7 later) and 35 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
conv3x3 686 other papers
169 dated earlier, 8 the same month, 509 later · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
resnet18 89 other papers
22 dated earlier, 1 the same month, 66 later
1705.09759 (2017-05)
CASENet: Deep Category-Aware Semantic Edge Detection
1801.07698 (2018-01)
ArcFace: Additive Angular Margin Loss for Deep Face Recognition
1803.00839 (2018-03)
Pose-Robust Face Recognition via Deep Residual Equivariant Mapping
and 86 more not named here
accuracy 80 other papers
27 dated earlier, 1 the same month, 52 later
1307.0414 (2013-07)
Challenges in Representation Learning: A report on three machine learning contests
1412.6553 (2014-12)
Speeding-up Convolutional Neural Networks Using Fine-tuned CP-Decomposition
1503.02531 (2015-03)
Distilling the Knowledge in a Neural Network
and 77 more not named here
resnet34 53 other papers
20 dated earlier, 1 the same month, 32 later
1705.09759 (2017-05)
CASENet: Deep Category-Aware Semantic Edge Detection
1801.07698 (2018-01)
ArcFace: Additive Angular Margin Loss for Deep Face Recognition
1803.00839 (2018-03)
Pose-Robust Face Recognition via Deep Residual Equivariant Mapping
and 50 more not named here
get_shuffle_ids 9 other papers
9 later · 1 only as an assembly brick
2007.07423 (2020-07)
Comparing to Learn: Surpassing ImageNet Pretraining on Radiographs By Comparing Image Representations
2008.00188 (2020-08)
Augmented Skeleton Based Contrastive Action Learning with Momentum LSTM for Unsupervised Action Recognition
2105.07269 (2021-05)
Mean Shift for Self-Supervised Learning
and 6 more not named here
ProjectionHead
brick of this paper's assembly: helper
3 other papers
3 later · 2 only as an assembly brick
2002.05709 (2020-02)
A Simple Framework for Contrastive Learning of Visual Representations
2011.10566 (2020-11)
Exploring Simple Siamese Representation Learning
2104.14548 (2021-04)
With a Little Help from My Friends: Nearest-Neighbor Contrastive Learning of Visual Representations
set_optimizer 2 other papers
1 dated earlier, 1 later
1906.05849 (2019-06)
Contrastive Multiview Coding
2203.05119 (2022-03)
MetAug: Contrastive Learning via Meta Feature Augmentation

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

More are linked than shown here.

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

Abstract

We present Momentum Contrast (MoCo) for unsupervised visual representation learning. From a perspective on contrastive learning [29] as dictionary look-up, we build a dynamic dictionary with a queue and a moving-averaged encoder. This enables building a large and consistent dictionary on-the-fly that facilitates contrastive unsupervised learning. MoCo provides competitive results under the common linear protocol on ImageNet classification. More importantly, the representations learned by MoCo transfer well to downstream tasks. MoCo can outperform its supervised pre-training counterpart in 7 detection/segmentation tasks on PASCAL VOC, COCO, and other datasets, sometimes surpassing it by large margins. This suggests that the gap between unsupervised and supervised representation learning has been largely closed in many vision tasks.

For agents

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

get_harvested_code_for_paper("1911.05722")
get_code_for_paper("1911.05722")
have("1911.05722")

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

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

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

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

Connect an agent — have() is free.