SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.12909 · NeurIPS · 2021

Compressive Visual Representations

Ian Fischer, John Canny, Kuang-Huei Lee, Sergio Guadarrama, Anurag Arnab

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 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 6 have no contract verdict; 1 failure of our instrument; 5 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/2109.12909.json · badge: /api/ran/2109.12909.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
google-research/compressive-visual-representations canonical (classifier label)
classifier basis: census
7 ran · 5 no recorded run
FunctionStatusWhere it lives
add_contrastive_loss Ran
ran on a synthesized input
google-research/compressive-visual-representations/compressive_visual_representations/objective.py
code served (permissive licence) · get_code("2c3f186a80593c53")
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. 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 tensorflow.compat.v2 as tf
import numpy as np

tf.enable_v2_behavior()

# Create a small hidden tensor of shape (B, dim) where B=2 (batch size), dim=4
# The function splits this into two parts of shape (1, 4) each
hidden = tf.constant(
    np.random.randn(2, 4).astype(np.float32),
    dtype=tf.float32
)

ARGS = {
    "hidden": hidden,
    "hidden_norm": True,
    "temperature": 0.1,
    "bidirectional": True,
    "double_batch_trick": True,
    "strategy": None,
}
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 tuple — a tuple output has no array shape of its own; none is 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
add_supervised_loss Ran
ran on a synthesized input
google-research/compressive-visual-representations/compressive_visual_representations/objective.py
code served (permissive licence) · get_code("1029520ddfa4b329")
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 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 tensorflow.compat.v2 as tf
from absl import flags

FLAGS = flags.FLAGS

# Test case 1: Binary cross entropy mode
flags.DEFINE_bool('use_binary_cross_entropy', True, 'Use binary cross entropy')

# Create small test tensors
batch_size = 2
num_classes = 4

# For binary cross entropy: labels and logits should have same shape
labels_binary = tf.constant([[0.0, 1.0, 0.0, 1.0], [1.0, 0.0, 1.0, 0.0]], dtype=tf.float32)
logits_binary = tf.constant([[0.1, 0.9, -0.1, 0.8], [-0.2, 0.1, 0.7, -0.3]], dtype=tf.float32)

ARGS = {
    'labels': labels_binary,
    'logits': logits_binary
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
absl, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:UnparsedFlagAccessError)
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
arg_natural_sort Ran
ran on a synthesized input
google-research/compressive-visual-representations/compressive_visual_representations/model.py
code served (permissive licence) · get_code("2b7c6aa449d316cc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; 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 re

def natural_key(string):
    """Key to use for "natural sorting".

  Based on https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/

  Args:
    string: The input string to produce key for

  Returns:
    key to use for natural sorting in conjunction with Python's built-in sort.
  """
    return [int(c) if c.isdigit() else c for c in re.split('(\\d+)', string)]

def arg_natural_sort(array):
    return [idx for idx, val in sorted(enumerate(array), key=lambda x: natural_key(x[1]))]

# Setup code
ARGS = {
    "array": ["file10.txt", "file2.txt", "file1.txt", "file20.txt"]
}
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 list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
natural_key Ran
ran on a synthesized input
google-research/compressive-visual-representations/compressive_visual_representations/model.py
code served (permissive licence) · get_code("53256e57b7ff1522")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 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 re

def natural_key(string):
    """Key to use for "natural sorting".

  Based on https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/

  Args:
    string: The input string to produce key for

  Returns:
    key to use for natural sorting in conjunction with Python's built-in sort.
  """
    return [int(c) if c.isdigit() else c for c in re.split('(\\d+)', string)]


ARGS = {
    "string": "file2.txt"
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
random_apply Ran
ran on a synthesized input
google-research/compressive-visual-representations/compressive_visual_representations/data_util.py
code served (permissive licence) · get_code("293ca4cd93119d57")
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.compat.v2 as tf

tf.enable_v2_behavior()

def simple_func(x):
    """Simple function that adds 1 to input."""
    return x + 1

ARGS = {
    "func": simple_func,
    "p": 0.7,
    "x": tf.constant([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)
}
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_brightness Ran
ran on a synthesized input
google-research/compressive-visual-representations/compressive_visual_representations/data_util.py
code served (permissive licence) · get_code("35f2f206e2a2532c")
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, 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.compat.v2 as tf
import numpy as np

# Create a small image tensor
# image should be a tensor that can be multiplied or passed to tf.image.random_brightness
# Using a small 2x3x3 image (height, width, channels)
image = tf.constant(np.random.rand(2, 3, 3).astype(np.float32))

# max_delta parameter - controls the range of brightness change
max_delta = 0.2

# impl parameter - can be 'simclrv2' or 'simclrv1'
impl = 'simclrv2'

ARGS = {
    'image': image,
    'max_delta': max_delta,
    'impl': impl
}
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, 3, 3) — shape (2, 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
tpu_cross_replica_concat Ran
ran; our contract draft was wrong, not the code
google-research/compressive-visual-representations/compressive_visual_representations/objective.py
code served (permissive licence) · get_code("cb79992de5bf735c")
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.compat.v2 as tf

# Enable eager execution for TensorFlow 2.x compatibility
tf.enable_v2_behavior()

# Create a small test tensor (batch=2, features=4)
test_tensor = tf.constant([[1.0, 2.0, 3.0, 4.0],
                           [5.0, 6.0, 7.0, 8.0]], dtype=tf.float32)

# Create a mock strategy with num_replicas_in_sync = 1 (effectively no distribution)
# This allows the function to execute without actual TPU infrastructure
class MockStrategy:
    def __init__(self, num_replicas=1):
        self.num_replicas_in_sync = num_replicas

mock_strategy = MockStrategy(num_replicas=1)

ARGS = {
    "tensor": test_tensor,
    "strategy": mock_strategy
}
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
add_weight_decay Not yet run
unverified (harvested, no recorded run)
google-research/compressive-visual-representations/compressive_visual_representations/model_util.py
code served (permissive licence) · get_code("bf0a0bdd5fe4e8e0")
How it ran

no invocation recorded.

cosine_ramping_schedule Not yet run
unverified (harvested, no recorded run)
google-research/compressive-visual-representations/compressive_visual_representations/model_util.py
code served (permissive licence) · get_code("7182c3d894d78468")
How it ran

no invocation recorded.

get_train_steps Not yet run
unverified (harvested, no recorded run)
google-research/compressive-visual-representations/compressive_visual_representations/model_util.py
code served (permissive licence) · get_code("14ec8ff095316493")
How it ran

no invocation recorded.

resnet Not yet run
unverified (harvested, no recorded run)
google-research/compressive-visual-representations/compressive_visual_representations/resnet.py
code served (permissive licence) · get_code("808316afe07e1036")
How it ran

no invocation recorded.

to_grayscale Not yet run
unverified (harvested, no recorded run)
google-research/compressive-visual-representations/compressive_visual_representations/data_util.py
code served (permissive licence) · get_code("661534bbe78e800f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 8 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
get_train_steps 4 other papers
2 dated earlier, 2 later
2006.05576 (2020-06)
Self-supervised Learning from a Multi-view Perspective
2006.10029 (2020-06)
Big Self-Supervised Models are Strong Semi-Supervised Learners
aaai_20650 (2022 (year only))
Adversarial Examples Can Be Effective Data Augmentation for Unsupervised Machine Learning
and 1 more not named here
to_grayscale 4 other papers
3 dated earlier, 1 later
2006.05576 (2020-06)
Self-supervised Learning from a Multi-view Perspective
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2108.10310 (2021-08)
Ranking Models in Unlabeled New Environments
and 1 more not named here
random_apply 1 other paper
1 later
2201.05125 (2022-01)
GradMax: Growing Neural Networks using Gradient Information
tpu_cross_replica_concat 1 other paper
1 dated earlier
2002.05709 (2020-02)
A Simple Framework for Contrastive Learning of Visual Representations

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

Learning effective visual representations that generalize well without human supervision is a fundamental problem in order to apply Machine Learning to a wide variety of tasks. Recently, two families of self-supervised methods, contrastive learning and latent bootstrapping, exemplified by SimCLR and BYOL respectively, have made significant progress. In this work, we hypothesize that adding explicit information compression to these algorithms yields better and more robust representations. We verify this by developing SimCLR and BYOL formulations compatible with the Conditional Entropy Bottleneck (CEB) objective, allowing us to both measure and control the amount of compression in the learned representation, and observe their impact on downstream tasks. Furthermore, we explore the relationship between Lipschitz continuity and compression, showing a tractable lower bound on the Lipschitz constant of the encoders we learn. As Lipschitz continuity is closely related to robustness, this provides a new explanation for why compressed models are more robust. Our experiments confirm that adding compression to SimCLR and BYOL significantly improves linear evaluation accuracies and model robustness across a wide range of domain shifts. In particular, the compressed version of BYOL achieves 76.0% Top-1 linear evaluation accuracy on ImageNet with ResNet-50, and 78.8% with ResNet-50 2x. 1 Recent contrastive approaches to self-supervised visual representation learning aim to learn representations that maximally capture the mutual information between two transformed views of an image [54,4,12,33,40]. The primary idea of these approaches is that this mutual information † Main contributors 1 Code available at https://github.com/google-research/compressive-visual-representations 35th Conference on Neural Information Processing Systems (NeurIPS 2021),

For agents

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

get_harvested_code_for_paper("2109.12909")
get_code_for_paper("2109.12909")
have("2109.12909")

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

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

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

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

Connect an agent — have() is free.