SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1807.03748 · arXiv.org · 2018

Representation Learning with Contrastive Predictive Coding

Oriol Vinyals, Yazhe Li, Aaron Van Den Oord

arXiv · PDF · Open in the Atlas

Code that ran

35 of 45 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (21 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 29 have no contract verdict; 5 failures of our instrument; 10 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/1807.03748.json · badge: /api/ran/1807.03748.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
facebookresearch/CPC_audio community
Papers with Code archive
8 ran · 1 no recorded run
ex4sperans/freesound-classification community (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
theolepage/ssl-for-slr community
Papers with Code archive
4 ran · 0 no recorded run
Medabid1/CPC community
Papers with Code archive
3 ran · 0 no recorded run
emadeldeen24/eval_ssl_ssc community
Papers with Code archive
2 ran · 0 no recorded run
yusuke0519/constrastive_predictive_coding community
Papers with Code archive
2 ran · 0 no recorded run
davidtellez/contrastive-predictive-coding community
Papers with Code archive
1 ran · 4 no recorded run
talipucar/PyFlow_CPC community
Papers with Code archive
1 ran · 1 no recorded run
bshall/VectorQuantizedCPC community
Papers with Code archive
1 ran · 0 no recorded run
chorowski-lab/hcpc community
Papers with Code archive
1 ran · 0 no recorded run
SPEECHCOG/cpc_pytorch community
Papers with Code archive
1 ran · 0 no recorded run
mf1024/Contrastive-Predictive-Coding-for-Image-Recognition-in-PyTorch community
Papers with Code archive
1 ran · 0 no recorded run
Linear95/CLUB community
Papers with Code archive
1 ran · 0 no recorded run
ziqiao-shang/aunce community
Papers with Code archive
1 ran · 0 no recorded run
lee-seon-woo/tscp2_pytorch community
Papers with Code archive
1 ran · 0 no recorded run
gbarello/CPCLibriSpeech community
Papers with Code archive
1 ran · 0 no recorded run
jefflai108/Contrastive-Predictive-Coding-PyTorch community
Papers with Code archive
0 ran · 1 no recorded run
flrngel/cpc-tensorflow community
Papers with Code archive
0 ran · 1 no recorded run
chorowski-lab/CPC_audio community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
Algorithm Ran
ran on a synthesized input · constructed an object; no result was computed
emadeldeen24/eval_ssl_ssc/algorithms.py
code served (permissive licence) · get_code("f1e8c76f248d416b")
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, Algorithm: 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

torch.manual_seed(0)

# Create a minimal configs dict
configs = {
    "num_classes": 10,
    "input_dim": 4,
    "hidden_dim": 8,
    "learning_rate": 0.001,
    "batch_size": 2,
}

ARGS = {
    "configs": configs,
}
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 Algorithm — 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 Algorithm 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
Autoregressive Ran
ran on a synthesized input · constructed an object; no result was computed
theolepage/ssl-for-slr/sslforslr/models/cpc/CPC.py
pointer only (licence: NONE) · get_code("fdb79f7c30db5b04")
How it ran

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

BaseCriterion Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/CPC_audio/cpc/criterion/criterion.py
code served (permissive licence) · get_code("98a0dd46a20ece2a")
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, BaseCriterion: 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

torch.manual_seed(0)

class BaseCriterion(nn.Module):

    def warmUp(self):
        return False

    def update(self):
        return

ARGS = {}
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 BaseCriterion — 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 BaseCriterion 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
CPCEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
talipucar/PyFlow_CPC/utils/model_utils.py
pointer only (licence: NONE) · get_code("90540cd2dfd95c3c")
How it ran

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

CPCLoss Ran
ran on a synthesized input · constructed an object; no result was computed
bshall/VectorQuantizedCPC/model.py
code served (permissive licence) · get_code("8a0edf707add84b8")
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, CPCLoss: 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)

# Parameters for CPCLoss
n_speakers_per_batch = 2
n_utterances_per_speaker = 3
n_prediction_steps = 4
n_negatives = 5
z_dim = 8
c_dim = 6

# Create dummy tensors for z and c
# z shape: (n_speakers_per_batch * n_utterances_per_speaker, time_steps, z_dim)
# We need enough time steps to satisfy: length = z.size(1) - n_prediction_steps // 2
# and z_shift needs: k:length + k, so we need at least n_prediction_steps // 2 + some buffer
time_steps = 20
z = torch.randn(n_speakers_per_batch * n_utterances_per_speaker, time_steps, z_dim)

# c shape: (n_speakers_per_batch * n_utterances_per_speaker, time_steps, c_dim)
c = torch.randn(n_speakers_per_batch * n_utterances_per_speaker, time_steps, c_dim)

ARGS = {
    "n_speakers_per_batch": n_speakers_per_batch,
    "n_utterances_per_speaker": n_utterances_per_speaker,
    "n_prediction_steps": n_prediction_steps,
    "n_negatives": n_negatives,
    "z_dim": z_dim,
    "c_dim": c_dim,
}
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 CPCLoss — 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 CPCLoss 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
CPCModel Ran
ran on a synthesized input · constructed an object; no result was computed
yusuke0519/constrastive_predictive_coding/cpc.py
pointer only (licence: NONE) · get_code("88f5e149a4a5701e")
How it ran

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

CPCModel Ran
ran on a synthesized input · constructed an object; no result was computed
theolepage/ssl-for-slr/sslforslr/models/cpc/CPC.py
pointer only (licence: NONE) · get_code("d553f5e8f537a269")
How it ran

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

CPCModel Ran
ran on a synthesized input · constructed an object; no result was computed
chorowski-lab/hcpc/cpc/model.py
code served (permissive licence) · get_code("c77e423112015a3b")
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, CPCModel: 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

torch.manual_seed(0)

# Define a minimal encoder that takes batchData and outputs encoded features
class SimpleEncoder(nn.Module):
    def __init__(self):
        super(SimpleEncoder, self).__init__()
        self.linear = nn.Linear(5, 6)
    
    def forward(self, x):
        # Input: (batch, time, features) -> Output: (batch, time, encoded_dim)
        return self.linear(x)

# Define a minimal AR (autoregressive) model
class SimpleAR(nn.Module):
    def __init__(self):
        super(SimpleAR, self).__init__()
        self.linear = nn.Linear(6, 7)
    
    def forward(self, x):
        # Input: (batch, encoded_dim, time) -> Output: (batch, context_dim, time)
        return self.linear(x.permute(0, 2, 1)).permute(0, 2, 1)

# Define a minimal quantizer
class SimpleQuantizer(nn.Module):
    def __init__(self):
        super(SimpleQuantizer, self).__init__()
        self.numUpdates = 0
    
    def forward(self, x):
        return x
    
    def computeLoss(self):
        return torch.tensor(0.1)

# Create instances
encoder = SimpleEncoder()
ar_model = SimpleAR()
quantizer_encodings = SimpleQuantizer()
quantizer_context = SimpleQuantizer()

ARGS = {
    "encoder": encoder,
    "AR": ar_model,
    "quantizerEncodings": quantizer_encodings,
    "quantizerContext": quantizer_context,
}
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 CPCModel — 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 CPCModel 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
CPCModel Ran
ran on a synthesized input · constructed an object; no result was computed
Medabid1/CPC/model.py
pointer only (licence: NONE) · get_code("0c6aa70299e39fb2")
How it ran

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

CPC_encoder Ran
ran on a synthesized input
SPEECHCOG/cpc_pytorch/cpc_model.py
pointer only (licence: NOASSERTION) · get_code("1c9942b4ab282406")
How it ran

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

ConstrainedLayer Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/CPC_audio/cpc/criterion/criterion.py
code served (permissive licence) · get_code("2ffe2c33220475ca")
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, ConstrainedLayer: 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
from numpy import prod

torch.manual_seed(0)

# Create a small linear module to wrap in ConstrainedLayer
# The module needs to have .weight and .bias attributes
# that getLayerNormalizationFactor and forward will use
module = nn.Linear(in_features=3, out_features=4)

ARGS = {
    "module": module,
    "equalized": True,
    "lrMul": 1.0,
    "initBiasToZero": True,
}
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 ConstrainedLayer — 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 ConstrainedLayer 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
ContextPredictionModel Ran
ran on a synthesized input · constructed an object; no result was computed
mf1024/Contrastive-Predictive-Coding-for-Image-Recognition-in-PyTorch/models.py
pointer only (licence: NONE) · get_code("1fb147a76c863ded")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, mf1024/Contrastive-Predictive-Coding-for-Image-Recognition-in-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.

EqualizedConv1d Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/CPC_audio/cpc/criterion/criterion.py
code served (permissive licence) · get_code("a31d5f299fb67dc8")
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, EqualizedConv1d: 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

torch.manual_seed(0)

ARGS = {
    "nChannelsPrevious": 3,
    "nChannels": 16,
    "kernelSize": 3,
    "padding": 1,
    "bias": True,
    "stride": 1,
    "equalized": True,
    "lrMul": 1.0,
    "initBiasToZero": True
}
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 EqualizedConv1d — 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 EqualizedConv1d 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
EqualizedLinear Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/CPC_audio/cpc/criterion/criterion.py
code served (permissive licence) · get_code("20bd3807784699b5")
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, EqualizedLinear: 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

torch.manual_seed(0)

ARGS = {
    "nChannelsPrevious": 4,
    "nChannels": 8,
    "bias": True,
    "equalized": True,
    "lrMul": 1.0,
    "initBiasToZero": True,
}
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 EqualizedLinear — 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 EqualizedLinear 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
FFNetwork Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/CPC_audio/cpc/criterion/criterion.py
code served (permissive licence) · get_code("a1fa550706a4d645")
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, FFNetwork: 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
from numpy import prod

torch.manual_seed(0)

ARGS = {
    "din": 4,
    "dout": 3,
    "dff": 8,
    "dropout": 0.1
}
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 FFNetwork — 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 FFNetwork 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
InfoNCE Ran
ran on a synthesized input · constructed an object; no result was computed
Linear95/CLUB/mi_estimators.py
pointer only (licence: NONE) · get_code("ef63ae1da9a9ed0b")
How it ran

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

PredictionNetwork Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/CPC_audio/cpc/criterion/criterion.py
code served (permissive licence) · get_code("1d652b465739caed")
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, PredictionNetwork: 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

torch.manual_seed(0)

ARGS = {
    "nPredicts": 2,
    "dimOutputAR": 4,
    "dimOutputEncoder": 3,
    "rnnMode": "ffd",
    "dropout": False,
    "sizeInputSeq": 116,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PredictionNetwork — 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 PredictionNetwork 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
Predictor Ran
ran on a synthesized input · constructed an object; no result was computed
theolepage/ssl-for-slr/sslforslr/models/cpc/CPC.py
pointer only (licence: NONE) · get_code("61e69ae0f2b2b9d6")
How it ran

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

Resblock Ran
ran on a synthesized input · constructed an object; no result was computed
Medabid1/CPC/model.py
pointer only (licence: NONE) · get_code("06beece7949a622a")
How it ran

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

ShiftedConv Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/CPC_audio/cpc/criterion/criterion.py
code served (permissive licence) · get_code("0608dabb9a52bed6")
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, ShiftedConv: 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
from numpy import prod

torch.manual_seed(0)

class ConstrainedLayer(nn.Module):
    """
    A handy refactor that allows the user to:
    - initialize one layer's bias to zero
    - apply He's initialization at runtime
    """

    def __init__(self, module, equalized=True, lrMul=1.0, initBiasToZero=True):
        """
        equalized (bool): if true, the layer's weight should evolve within
                         the range (-1, 1)
        initBiasToZero (bool): if true, bias will be initialized to zero
        """
        super(ConstrainedLayer, self).__init__()
        self.module = module
        self.equalized = equalized
        if initBiasToZero and module.bias is not None:
            self.module.bias.data.fill_(0)
        if self.equalized:
            self.module.weight.data.normal_(0, 1)
            self.weight = getLayerNormalizationFactor(self.module) * lrMul

    def forward(self, x):
        x = self.module(x)
        if self.equalized:
            x *= self.weight
        return x

class EqualizedConv1d(ConstrainedLayer):

    def __init__(self, nChannelsPrevious, nChannels, kernelSize, padding=0, bias=True, stride=1, **kwargs):
        """
        A nn.Conv2d module with specific constraints
        Args:
            nChannelsPrevious (int): number of channels in the previous layer
            nChannels (int): number of channels of the current layer
            kernelSize (int): size of the convolutional kernel
            padding (int): convolution's padding
            bias (bool): with bias ?
        """
        ConstrainedLayer.__init__(self, nn.Conv1d(nChannelsPrevious, nChannels, kernelSize, padding=padding, bias=bias, stride=stride), **kwargs)

def getLayerNormalizationFactor(x):
    """
    Get He's constant for the given layer
    https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/He_Delving_Deep_into_ICCV_2015_paper.pdf
    """
    size = x.weight.size()
    fan_in = prod(size[1:])
    return math.sqrt(2.0 / fan_in)

class ShiftedConv(nn.Module):

    def __init__(self, dimOutputAR, dimOutputEncoder, kernelSize):
        super(ShiftedConv, self).__init__()
        self.module = EqualizedConv1d(dimOutputAR, dimOutputEncoder, kernelSize, equalized=True, padding=0)
        self.kernelSize = kernelSize

    def forward(self, x):
        N, S, C = x.size()
        x = x.permute(0, 2, 1)
        padding = torch.zeros(N, C, self.kernelSize - 1, device=x.device)
        x = torch.cat([padding, x], dim=2)
        x = self.module(x)
        x = x.permute(0, 2, 1)
        return x

ARGS = {
    "dimOutputAR": 3,
    "dimOutputEncoder": 5,
    "kernelSize": 4
}
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 ShiftedConv — 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 ShiftedConv 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
au_infonce_loss Ran
ran; our contract draft was wrong, not the code
ziqiao-shang/aunce/losses.py
pointer only (licence: NONE) · get_code("e5a1ba36ae15b5da")
How it ran

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

binary_cross_entropy Ran
ran on a synthesized input
ex4sperans/freesound-classification/networks/losses.py
code served (permissive licence) · get_code("45983305e1fcaaef")
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)

# Create small tensors for binary cross entropy
# input: raw logits (before sigmoid) - shape [2, 4]
input_tensor = torch.randn(2, 4)

# target: binary labels - shape [2, 4], values in [0, 1]
target_tensor = torch.randint(0, 2, (2, 4)).float()

ARGS = {
    "input": input_tensor,
    "target": target_tensor,
    "raw": 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 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
cpc Ran
ran on a synthesized input · constructed an object; no result was computed
emadeldeen24/eval_ssl_ssc/algorithms.py
code served (permissive licence) · get_code("ed486b5fa192c61f")
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, cpc: 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 numpy as np

torch.manual_seed(0)

# Define minimal backbone feature extractor
class BackboneFE(nn.Module):
    def __init__(self, configs):
        super().__init__()
        self.conv = nn.Conv1d(1, 4, kernel_size=3, padding=1)
    
    def forward(self, x):
        # Input: (batch, channels, seq_len) or similar
        # Output: (batch, num_channels, seq_len)
        if len(x.shape) == 2:
            x = x.unsqueeze(1)
        return self.conv(x)

# Define minimal temporal encoder
class BackboneTemporal(nn.Module):
    def __init__(self, hparams):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

# Define minimal classifier
class Classifier(nn.Module):
    def __init__(self, configs, hparams):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)

# Define configs and hparams dicts
configs = {
    'num_features': 4,
    'num_classes': 2,
}

hparams = {
    'learning_rate': 0.001,
    'weight_decay': 0.0,
    'num_channels': 4,
    'hid_dim': 5,
    'timesteps': 3,
    'batch_size': 2,
}

device = 'cpu'

# Create sample data
batch_size = 2
seq_len = 10
num_channels = 1
samples = {
    'sample_ori': torch.randn(batch_size, num_channels, seq_len),
}

ARGS = {
    'backbone_fe': BackboneFE,
    'backbone_temporal': BackboneTemporal,
    'classifier': Classifier,
    'configs': configs,
    'hparams': hparams,
    'device': device,
}
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 cpc — 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 cpc 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
cpc_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
theolepage/ssl-for-slr/sslforslr/models/cpc/CPC.py
pointer only (licence: NONE) · get_code("bf44986039feb903")
How it ran

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

encoder Ran
ran on a synthesized input · constructed an object; no result was computed
Medabid1/CPC/model.py
pointer only (licence: NONE) · get_code("4f22c55f43f447da")
How it ran

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

find_threshold Ran
ran on a synthesized input
ex4sperans/freesound-classification/relabel_noisy_data.py
code served (permissive licence) · get_code("9ea8495cf4597e1e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function:
# - probs: appears to be a numpy array that supports:
#   - comparison operator (>)
#   - .sum(-1) method (sum over last axis)
#   - should have shape where sum(-1) then .mean() makes sense
# - expected_classes_per_sample: a scalar value (float or int)

# Create small sample data
np.random.seed(0)

# probs should be a 2D array (batch_size, num_classes)
# Shape: (2, 4) - 2 samples, 4 classes
probs = np.random.rand(2, 4).astype(np.float32)

# expected_classes_per_sample: scalar representing average number of classes
# per sample we want to find threshold for
expected_classes_per_sample = 1.5

ARGS = {
    "probs": probs,
    "expected_classes_per_sample": expected_classes_per_sample,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
focal_loss Ran
ran on a synthesized input
ex4sperans/freesound-classification/networks/losses.py
code served (permissive licence) · get_code("25b22350f74af590")
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

torch.manual_seed(0)

# Create small tensors for focal loss
# input: raw logits (before sigmoid), shape (2, 4) for batch_size=2, num_classes=4
input_tensor = torch.randn(2, 4)

# target: binary targets, shape (2, 4) matching input
target_tensor = torch.randint(0, 2, (2, 4)).float()

# focus parameter: modulation factor for focal loss
focus_param = 2.0

# raw parameter: whether input needs sigmoid applied
raw_param = True

ARGS = {
    "input": input_tensor,
    "target": target_tensor,
    "focus": focus_param,
    "raw": raw_param,
}
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
getLayerNormalizationFactor Ran
ran, honoured the contract we drafted
facebookresearch/CPC_audio/cpc/criterion/criterion.py
code served (permissive licence) · get_code("8dd3d0253826c3e4")
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 float, 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 as nn
import math
from numpy import prod

torch.manual_seed(0)

class SimpleLayer(nn.Module):
    def __init__(self):
        super().__init__()
        # weight shape: (output_features, input_features, ...)
        # Using shape (3, 4, 2) to have distinct dimensions
        self.weight = nn.Parameter(torch.randn(3, 4, 2))
    
    def forward(self, x):
        return x

x = SimpleLayer()

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
get_context Ran
ran; our contract draft was wrong, not the code
yusuke0519/constrastive_predictive_coding/cpc.py
pointer only (licence: NONE) · get_code("3fd9a785ec6e3e12")
How it ran

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

info_nce Ran
ran; our contract draft was wrong, not the code
lee-seon-woo/tscp2_pytorch/src/models/losses.py
code served (permissive licence) · get_code("4bd8a922e4fd21df")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create small tensors with distinct dimensions
# history: [batch_size=2, embedding_dim=4]
# future: [batch_size=2, embedding_dim=4]
batch_size = 2
embedding_dim = 4

history = torch.randn(batch_size, embedding_dim)
future = torch.randn(batch_size, embedding_dim)

temperature = 0.1
reduction = 'mean'

ARGS = {
    'history': history,
    'future': future,
    'temperature': temperature,
    'reduction': reduction
}
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 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
load_predictions Ran
ran on a synthesized input
ex4sperans/freesound-classification/linear_blend.py
code served (permissive licence) · get_code("69d65c023623a577")
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 DataFrame. 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 tempfile
import os
from pathlib import Path
import pandas as pd

# Create a temporary directory structure for the experiment
tmpdir = tempfile.mkdtemp()
experiment_name = "test_experiment"
experiment_path = Path(tmpdir) / "experiments" / experiment_name / "predictions"
experiment_path.mkdir(parents=True, exist_ok=True)

# Create sample prediction files
df1 = pd.DataFrame({
    'fname': ['file1.jpg', 'file2.jpg'],
    'score': [0.9, 0.8],
    'label': ['cat', 'dog']
})

df2 = pd.DataFrame({
    'fname': ['file3.jpg', 'file4.jpg'],
    'score': [0.7, 0.6],
    'label': ['bird', 'fish']
})

# Write the CSV files with the expected naming pattern
df1.to_csv(experiment_path / 'val_preds_0.csv', index=False)
df2.to_csv(experiment_path / 'val_preds_1.csv', index=False)

# Update the working directory to use this temp directory for path resolution
original_cwd = os.getcwd()
os.chdir(tmpdir)

ARGS = {
    'experiment': experiment_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
lsep_loss_stable Ran
ran on a synthesized input
ex4sperans/freesound-classification/networks/losses.py
code served (permissive licence) · get_code("6a0ad9f55e1c06f2")
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

torch.manual_seed(0)

# Create small tensors for input and target
# input: scores/predictions, shape (batch_size, num_classes)
# target: target labels/scores, shape (batch_size, num_classes)
batch_size = 2
num_classes = 4

input_tensor = torch.randn(batch_size, num_classes)
target_tensor = torch.randn(batch_size, num_classes)

ARGS = {
    "input": input_tensor,
    "target": target_tensor,
    "average": 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 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
multi_batch_InfoNCE_loss Ran
ran on a synthesized input
gbarello/CPCLibriSpeech/CPCLibriSpeech/model_management/build_models.py
pointer only (licence: NONE) · get_code("6d4dd79504cddf0f")
How it ran

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

network_autoregressive Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
davidtellez/contrastive-predictive-coding/train_model.py
pointer only (licence: NONE) · get_code("65037d99b31b9ae7")
How it ran

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

nonzero Ran
ran on a synthesized input
ex4sperans/freesound-classification/relabel_noisy_data.py
code served (permissive licence) · get_code("7ca3643dc4275445")
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 ndarray, ndim 1, dtype family int, shape (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 numpy as np

# The function nonzero takes a single parameter x which is passed to np.nonzero()
# np.nonzero() expects an array-like object and returns a tuple of arrays
# We need to provide a numpy array with some zero and non-zero elements

x = np.array([0, 1, 0, 2, 3, 0, 5])

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (4,) — shape (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
CDCK2 Not yet run
unverified (harvested, no recorded run)
jefflai108/Contrastive-Predictive-Coding-PyTorch/src/model/model.py
code served (permissive licence) · get_code("bacdbc0bbfe53598")
How it ran

no invocation recorded.

CPC Not yet run
unverified (harvested, no recorded run)
talipucar/PyFlow_CPC/utils/model_utils.py
pointer only (licence: NONE) · get_code("274596d912e6af16")
How it ran

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

CPC Not yet run
unverified (harvested, no recorded run)
flrngel/cpc-tensorflow/model.py
pointer only (licence: NONE) · get_code("e720870fffa7cffb")
How it ran

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

CPCLayer Not yet run
unverified (harvested, no recorded run)
davidtellez/contrastive-predictive-coding/train_model.py
pointer only (licence: NONE) · get_code("d3271e5b8a942d2c")
How it ran

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

CPCModel Not yet run
unverified (harvested, no recorded run)
chorowski-lab/CPC_audio/cpc/model.py
code served (permissive licence) · get_code("591507cec9d8ebf7")
How it ran

no invocation recorded.

CPCUnsupersivedCriterion Not yet run
unverified (harvested, no recorded run)
facebookresearch/CPC_audio/cpc/criterion/criterion.py
code served (permissive licence) · get_code("4c96c9c7dcdc4ecf")
How it ran

no invocation recorded.

network_cpc Not yet run
unverified (harvested, no recorded run)
davidtellez/contrastive-predictive-coding/train_model.py
pointer only (licence: NONE) · get_code("6561bbee1ff09943")
How it ran

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

network_encoder Not yet run
unverified (harvested, no recorded run)
davidtellez/contrastive-predictive-coding/train_model.py
pointer only (licence: NONE) · get_code("9fe706cb1512ff06")
How it ran

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

network_prediction Not yet run
unverified (harvested, no recorded run)
davidtellez/contrastive-predictive-coding/train_model.py
pointer only (licence: NONE) · get_code("4e5d092bb8222498")
How it ran

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

to_ranks Not yet run
unverified (harvested, no recorded run)
ex4sperans/freesound-classification/linear_blend.py
code served (permissive licence) · get_code("0d20ad5fe3e59410")
How it ran

no invocation recorded.

Also present in other papers' code

Of 45 samples lifted from this paper's linked repositories, 45 carry a function identity and 0 do not. Of the 45 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 42 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
getLayerNormalizationFactor
brick of this paper's assembly: helper
3 other papers
3 later · 3 only as an assembly brick
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2106.06056 (2021-06)
Progressive-Scale Boundary Blackbox Attack via Projective Gradient Estimation
2305.02618 (2023-05)
Semantic-aware Generation of Multi-view Portrait Drawings
EqualizedLinear
brick of this paper's assembly: helper
2 other papers
2 later · 1 only as an assembly brick
1812.04948 (2018-12)
A Style-Based Generator Architecture for Generative Adversarial Networks
2106.06056 (2021-06)
Progressive-Scale Boundary Blackbox Attack via Projective Gradient Estimation
CPCModel
brick of this paper's assembly: entry
1 other paper
1 later
2603.26515 (2026-03)
JAL-Turn: Joint Acoustic-Linguistic Modeling for Real-Time and Robust Turn-Taking Detection in Full-Duplex Spoken Dialogue Systems

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

While supervised learning has enabled great progress in many applications, unsupervised learning has not seen such widespread adoption, and remains an important and challenging endeavor for artificial intelligence. In this work, we propose a universal unsupervised learning approach to extract useful representations from high-dimensional data, which we call Contrastive Predictive Coding. The key insight of our model is to learn such representations by predicting the future in latent space by using powerful autoregressive models. We use a probabilistic contrastive loss which induces the latent space to capture information that is maximally useful to predict future samples. It also makes the model tractable by using negative sampling. While most prior work has focused on evaluating representations for a particular modality, we demonstrate that our approach is able to learn useful representations achieving strong performance on four distinct domains: speech, images, text and reinforcement learning in 3D environments.

For agents

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

get_harvested_code_for_paper("1807.03748")
get_code_for_paper("1807.03748")
have("1807.03748")

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

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

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

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

Connect an agent — have() is free.