SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.09882 · NeurIPS · 2020

Unsupervised Learning of Visual Features by Contrasting Cluster Assignments

Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, Armand Joulin

arXiv · PDF · Open in the Atlas

Code that ran

13 of 17 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 4 have no contract verdict; 7 failures of our instrument; 4 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/2006.09882.json · badge: /api/ran/2006.09882.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
ayulockin/SwAV-TF port (classifier label)
classifier basis: classifier_2025
7 ran · 2 no recorded run
buyeah1109/finc community
Papers with Code archive
3 ran · 0 no recorded run
facebookresearch/clip-rocket community
Papers with Code archive
2 ran · 1 no recorded run
lightly-ai/lightly community
Papers with Code archive
1 ran · 1 no recorded run
FunctionStatusWhere it lives
CL2LLoss Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/clip-rocket/losses.py
pointer only (licence: NOASSERTION) · get_code("65ea068099ec8a00")
How it ran

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

ImageFeatureExtractor Ran
ran on a synthesized input · constructed an object; no result was computed
buyeah1109/finc/src/features/SwAVFeatureExtractor.py
pointer only (licence: NONE) · get_code("d66b0649e0c37be9")
How it ran

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

SwAVFeatureExtractor Ran
ran on a synthesized input · constructed an object; no result was computed
buyeah1109/finc/src/features/SwAVFeatureExtractor.py
pointer only (licence: NONE) · get_code("ef7fd0fad6c1ce99")
How it ran

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

TransformedIndexDataset Ran
ran on a synthesized input · constructed an object; no result was computed
buyeah1109/finc/src/features/SwAVFeatureExtractor.py
pointer only (licence: NONE) · get_code("ba4892e53d17ff07")
How it ran

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

all_gather_batch Ran
ran; our contract draft was wrong, not the code
facebookresearch/clip-rocket/losses.py
pointer only (licence: NOASSERTION) · get_code("99efca6b93eccdc4")
How it ran

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

color_jitter Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ayulockin/SwAV-TF/utils/multicrop_dataset.py
code served (permissive licence) · get_code("9409540d35684afe")
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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

# Create a small image tensor for color jitter
# Shape: (batch_size, height, width, channels)
# Using batch=2, height=4, width=3, channels=3 (RGB)
x = tf.constant(np.random.rand(2, 4, 3, 3).astype(np.float32))

# Define ARGS dict with all parameters
ARGS = {
    "x": x,
    "s": 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 3) — shape (2, 4, 3, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gaussian_blur Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ayulockin/SwAV-TF/utils/multicrop_dataset.py
code served (permissive licence) · get_code("c0f578da1f63b8dc")
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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 5) 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 tensorflow as tf
import numpy as np

# Create a small test image with shape (batch, height, width, channels)
# Using distinct dimensions: batch=2, height=4, width=3, channels=5
image = tf.constant(
    np.random.randn(2, 4, 3, 5).astype(np.float32)
)

# Also test with 3D image (no batch dimension)
image_3d = tf.constant(
    np.random.randn(4, 3, 5).astype(np.float32)
)

ARGS = {
    "image": image,
    "kernel_size": 23,
    "padding": "SAME"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) 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_multires_dataset Ran
ran; our contract draft was wrong, not the code
ayulockin/SwAV-TF/utils/multicrop_dataset.py
code served (permissive licence) · get_code("d10fcd33136b539d")
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 1, 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 tensorflow as tf
import numpy as np

# Create a minimal dataset that mimics the expected structure
def create_dummy_dataset():
    """Create a small dummy dataset with 'image' key"""
    # Create 4 dummy images (batch of 4, 32x32 RGB images)
    images = np.random.randint(0, 256, size=(4, 32, 32, 3), dtype=np.uint8)
    
    # Create a dataset that yields dicts with 'image' key
    dataset = tf.data.Dataset.from_tensor_slices({'image': images})
    return dataset

# Set up the arguments
dataset = create_dummy_dataset()
size_crops = [224, 96]  # Two different crop sizes
num_crops = [2, 6]      # 2 crops of size 224, 6 crops of size 96
min_scale = [0.14, 0.05]  # Minimum scale for each crop size
max_scale = [1.0, 0.14]    # Maximum scale for each crop size
options = None  # No special options

ARGS = {
    'dataset': dataset,
    'size_crops': size_crops,
    'num_crops': num_crops,
    'min_scale': min_scale,
    'max_scale': max_scale,
    'options': options
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
random_apply Ran
ran; our contract draft was wrong, not the code
ayulockin/SwAV-TF/utils/multicrop_dataset.py
code served (permissive licence) · get_code("f63e696498472c1e")
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 EagerTensor, 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 tensorflow as tf

# Define a simple function that can be applied to x
def simple_transform(x):
    return x * 2.0

# Create a small input tensor
x = tf.constant([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)

# Define probability as a scalar
p = 0.7

# Construct the arguments dictionary
ARGS = {
    "func": simple_transform,
    "x": x,
    "p": p,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
random_resize_crop Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ayulockin/SwAV-TF/utils/multicrop_dataset.py
code served (permissive licence) · get_code("9804c7348e6e7ece")
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 EagerTensor, ndim 3, dtype family float, shape (224, 224, 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 tensorflow as tf
import numpy as np

# Create a small dummy image tensor
# The function expects shape (height, width, channels)
# Using a small 4x4x3 image
image = tf.constant(np.random.rand(4, 4, 3).astype(np.float32))

# min_scale and max_scale are used to determine random crop size
# They are multiplied by image_shape (either 260 or 160)
min_scale = 0.5
max_scale = 0.9

# crop_size determines final output size and which image_shape to use
crop_size = 224

ARGS = {
    "image": image,
    "min_scale": min_scale,
    "max_scale": max_scale,
    "crop_size": crop_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (224, 224, 3) — shape (224, 224, 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
scale_image Ran
ran, violated the contract we drafted
ayulockin/SwAV-TF/utils/multicrop_dataset.py
code served (permissive licence) · get_code("aa8570de6f4e85b0")
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 EagerTensor, ndim 3, dtype family float, shape (2, 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 tensorflow as tf
import numpy as np

# Create a small test image
# Using uint8 dtype (common for images)
image_data = np.array([
    [[255, 128, 64],
     [200, 100, 50]],
    [[150, 75, 25],
     [100, 50, 10]]
], dtype=np.uint8)

# Convert to TensorFlow tensor
image = tf.constant(image_data)

ARGS = {
    "image": image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (2, 2, 3) — shape (2, 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
sinkhorn Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lightly-ai/lightly/lightly/loss/swav_loss.py
code served (permissive licence) · get_code("58db645a1b52ab84")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 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 similarity tensor between features and prototypes
# Shape: (batch_size, num_prototypes)
# The function expects this to be log-probabilities or similarities
out = torch.randn(2, 4)

ARGS = {
    "out": out,
    "iterations": 3,
    "epsilon": 0.05,
    "gather_distributed": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 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
tie_together Ran
ran, honoured the contract we drafted
ayulockin/SwAV-TF/utils/multicrop_dataset.py
code served (permissive licence) · get_code("f87ad47efb0bcc47")
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 EagerTensor, ndim 3, dtype family float, shape (224, 224, 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 tensorflow as tf
import numpy as np

# Create a small test image as a dictionary with 'image' key
# The function expects image['image'] to be a tensor
test_image = np.random.randint(0, 256, size=(4, 4, 3), dtype=np.uint8)
image_dict = {'image': test_image}

ARGS = {
    'image': image_dict,
    'min_scale': 0.5,
    'max_scale': 0.9,
    'crop_size': 224
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (224, 224, 3) — shape (224, 224, 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
SwALIPLoss Not yet run
unverified (harvested, no recorded run)
facebookresearch/clip-rocket/losses.py
pointer only (licence: NOASSERTION) · get_code("9b6d7a79e463251f")
How it ran

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

SwaVLoss Not yet run
unverified (harvested, no recorded run)
lightly-ai/lightly/lightly/loss/swav_loss.py
code served (permissive licence) · get_code("03392c922af8bf4c")
How it ran

no invocation recorded.

color_drop Not yet run
unverified (harvested, no recorded run)
ayulockin/SwAV-TF/utils/multicrop_dataset.py
code served (permissive licence) · get_code("1f7646e4cd1d0e9e")
How it ran

no invocation recorded.

custom_augment Not yet run
unverified (harvested, no recorded run)
ayulockin/SwAV-TF/utils/multicrop_dataset.py
code served (permissive licence) · get_code("451594dfca49b64d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 14 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
ImageFeatureExtractor
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
TransformedIndexDataset
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
all_gather_batch
brick of this paper's assembly: helper
1 other paper
1 later
2402.01832 (2024-02)
SynthCLIP: Are We Ready for a Fully Synthetic CLIP Training?

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

Unsupervised image representations have significantly reduced the gap with supervised pretraining, notably with the recent achievements of contrastive learning methods. These contrastive methods typically work online and rely on a large number of explicit pairwise feature comparisons, which is computationally challenging. In this paper, we propose an online algorithm, SwAV, that takes advantage of contrastive methods without requiring to compute pairwise comparisons. Specifically, our method simultaneously clusters the data while enforcing consistency between cluster assignments produced for different augmentations (or "views") of the same image, instead of comparing features directly as in contrastive learning. Simply put, we use a "swapped" prediction mechanism where we predict the code of a view from the representation of another view. Our method can be trained with large and small batches and can scale to unlimited amounts of data. Compared to previous contrastive methods, our method is more memory efficient since it does not require a large memory bank or a special momentum network. In addition, we also propose a new data augmentation strategy, multi-crop, that uses a mix of views with different resolutions in place of two full-resolution views, without increasing the memory or compute requirements. We validate our findings by achieving 75.3% top-1 accuracy on ImageNet with ResNet-50, as well as surpassing supervised pretraining on all the considered transfer tasks.

For agents

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

get_harvested_code_for_paper("2006.09882")
get_code_for_paper("2006.09882")
have("2006.09882")

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

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

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

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

Connect an agent — have() is free.