SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.00519 · ICLR · 2024

REBAR: RETRIEVAL-BASED RECONSTRUCTION FOR TIME-SERIES CONTRASTIVE LEARNING

Benjamin Marlin, James Rehg, Maxwell Xu, Alexander Moreno, Hui Wei

arXiv · PDF · Open in the Atlas

Code that ran

10 of 20 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 8 have no contract verdict; 2 failures of our instrument; 10 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/2311.00519.json · badge: /api/ran/2311.00519.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
maxxu05/rebar canonical (classifier label)
classifier basis: classifier_2025
10 ran · 10 no recorded run
FunctionStatusWhere it lives
ConvBlock Ran
ran on a synthesized input
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("032b67e962be8a73")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 8, 16) 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

INIT_ARGS = {
    'in_channels': 4,
    'out_channels': 8,
    'kernel_size': 3,
    'dilation': 1,
    'final': False,
}

ARGS = {
    'x': torch.randn(2, 4, 16),
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 8, 16) — shape (2, 8, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
DilatedConvEncoder Ran
ran on a synthesized input
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("d8ef63e77b9e62e8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 8, 16) 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

class SamePadConv(torch.nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size, dilation=1, groups=1):
        super().__init__()
        self.receptive_field = (kernel_size - 1) * dilation + 1
        padding = self.receptive_field // 2
        self.conv = torch.nn.Conv1d(in_channels, out_channels, kernel_size, padding=padding, dilation=dilation, groups=groups)
        self.remove = 1 if self.receptive_field % 2 == 0 else 0

    def forward(self, x):
        out = self.conv(x)
        if self.remove > 0:
            out = out[:, :, :-self.remove]
        return out

class ConvBlock(torch.nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size, dilation, final=False):
        super().__init__()
        self.conv1 = SamePadConv(in_channels, out_channels, kernel_size, dilation=dilation)
        self.conv2 = SamePadConv(out_channels, out_channels, kernel_size, dilation=dilation)
        self.projector = torch.nn.Conv1d(in_channels, out_channels, 1) if in_channels != out_channels or final else None

    def forward(self, x):
        residual = x if self.projector is None else self.projector(x)
        x = torch.nn.functional.gelu(x)
        x = self.conv1(x)
        x = torch.nn.functional.gelu(x)
        x = self.conv2(x)
        return x + residual

class DilatedConvEncoder(torch.nn.Module):
    def __init__(self, in_channels, channels, kernel_size):
        super().__init__()
        self.net = torch.nn.Sequential(*[ConvBlock(channels[i - 1] if i > 0 else in_channels, channels[i], kernel_size=kernel_size, dilation=2 ** i, final=i == len(channels) - 1) for i in range(len(channels))])

    def forward(self, x):
        return self.net(x)

INIT_ARGS = {
    'in_channels': 3,
    'channels': [4, 8],
    'kernel_size': 3,
}

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

model = DilatedConvEncoder(**INIT_ARGS)
output = model(**ARGS)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 8, 16) — shape (2, 8, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
PartialConv1d Ran
ran on a synthesized input
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("5c264d8180b9ea93")
How it ran

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

import torch
import torch.nn as nn
import torch.nn.functional as F

class PartialConv1d(nn.Conv1d):

    def __init__(self, *args, fixratio=True, **kwargs):
        if 'multi_channel' in kwargs:
            self.multi_channel = kwargs['multi_channel']
            kwargs.pop('multi_channel')
        else:
            self.multi_channel = False
        if 'return_mask' in kwargs:
            self.return_mask = kwargs['return_mask']
            kwargs.pop('return_mask')
        else:
            self.return_mask = False
        super(PartialConv1d, self).__init__(*args, **kwargs)
        if self.multi_channel:
            self.weight_maskUpdater = torch.ones(self.out_channels, self.in_channels, self.kernel_size[0])
        else:
            self.weight_maskUpdater = torch.ones(1, 1, self.kernel_size[0])
        self.slide_winsize = self.weight_maskUpdater.shape[1] * self.weight_maskUpdater.shape[2]
        self.last_size = (None, None, None, None)
        self.update_mask = None
        self.mask_ratio = None
        self.fixratio = fixratio

    def forward(self, input, mask_in):
        assert len(input.shape) == 3
        if mask_in is not None or self.last_size != tuple(input.shape):
            self.last_size = tuple(input.shape)
            with torch.no_grad():
                if self.weight_maskUpdater.type() != input.type():
                    self.weight_maskUpdater = self.weight_maskUpdater.to(input)
                if mask_in is None:
                    if self.multi_channel:
                        mask = torch.ones(input.data.shape[0], input.data.shape[1], input.data.shape[2]).to(input)
                    else:
                        mask = torch.ones(1, 1, input.data.shape[2]).to(input)
                else:
                    mask = mask_in.float()
                self.update_mask = F.conv1d(mask, self.weight_maskUpdater, bias=None, stride=self.stride, padding=self.padding, dilation=self.dilation, groups=1)
                self.mask_ratio = self.slide_winsize / (self.update_mask + 1e-08)
                self.update_mask = torch.clamp(self.update_mask, 0, 1)
                if self.fixratio:
                    self.mask_ratio = torch.mul(self.mask_ratio, self.update_mask)
                else:
                    self.mask_ratio = 1
        raw_out = super(PartialConv1d, self).forward(torch.mul(input, mask) if mask_in is not None else input)
        if self.bias is not None:
            bias_view = self.bias.view(1, self.out_channels, 1)
            output = torch.mul(raw_out - bias_view, self.mask_ratio) + bias_view
            output = torch.mul(output, self.update_mask)
        else:
            output = torch.mul(raw_out, self.mask_ratio)
        if self.return_mask:
            return (output, self.update_mask)
        else:
            return output


INIT_ARGS = {
    'in_channels': 4,
    'out_channels': 3,
    'kernel_size': 3,
    'stride': 1,
    'padding': 1,
    'dilation': 1,
    'groups': 1,
    'bias': True,
    'padding_mode': 'zeros',
    'fixratio': True,
    'multi_channel': False,
    'return_mask': False,
}

ARGS = {
    'input': torch.randn(2, 4, 16),
    'mask_in': None,
}

if __name__ == '__main__':
    model = PartialConv1d(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Test passed!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
REBAR_CrossAttn_Config Ran
ran on a synthesized input
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("1c9448d608e6c3c8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned NoneType. 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

class REBAR_CrossAttn_Config:

    def __init__(self, double_receptivefield: int, mask_extended: int, rebarcrossattn_batch_size: int, rebarcrossattn_epochs: int, rebarcrossattn_save_epochfreq: int=20, rebarcrossattn_retrain: bool=False):
        self.double_receptivefield = double_receptivefield
        self.mask_extended = mask_extended
        self.rebarcrossattn_batch_size = rebarcrossattn_batch_size
        self.rebarcrossattn_epochs = rebarcrossattn_epochs
        self.rebarcrossattn_save_epochfreq = rebarcrossattn_save_epochfreq
        self.rebarcrossattn_retrain = rebarcrossattn_retrain

    def update(self, run_dir, subseq_size, device, input_dims):
        self.run_dir, self.subseq_size, self.device, self.input_dims = (run_dir, subseq_size, device, input_dims)


INIT_ARGS = {
    'double_receptivefield': 16,
    'mask_extended': 8,
    'rebarcrossattn_batch_size': 2,
    'rebarcrossattn_epochs': 5,
    'rebarcrossattn_save_epochfreq': 20,
    'rebarcrossattn_retrain': False,
}

ARGS = {
    'run_dir': '/tmp/test_run',
    'subseq_size': 32,
    'device': 'cpu',
    'input_dims': 4,
}

METHOD = 'update'

if __name__ == '__main__':
    config = REBAR_CrossAttn_Config(**INIT_ARGS)
    config.update(**ARGS)
    print(f"Config created: double_receptivefield={config.double_receptivefield}, mask_extended={config.mask_extended}")
    print(f"Config updated: run_dir={config.run_dir}, subseq_size={config.subseq_size}, device={config.device}, input_dims={config.input_dims}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RevIN Ran
ran on a synthesized input
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("5682c8bbc83e0654")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 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
from torch import nn

class RevIN(nn.Module):

    def __init__(self, num_features: int, eps=1e-05, affine=True):
        """
        :param num_features: the number of features or channels
        :param eps: a value added for numerical stability
        :param affine: if True, RevIN has learnable affine parameters
        """
        super(RevIN, self).__init__()
        self.num_features = num_features
        self.eps = eps
        self.affine = affine
        if self.affine:
            self._init_params()

    def forward(self, x, mode: str, recalc_stats=True):
        if mode == 'norm':
            if recalc_stats:
                self._get_statistics(x)
            x = self._normalize(x)
        elif mode == 'denorm':
            x = self._denormalize(x)
        else:
            raise NotImplementedError
        return x

    def _init_params(self):
        self.affine_weight = nn.Parameter(torch.ones(self.num_features))
        self.affine_bias = nn.Parameter(torch.zeros(self.num_features))

    def _get_statistics(self, x):
        dim2reduce = tuple(range(1, x.ndim - 1))
        self.mean = torch.mean(x, dim=dim2reduce, keepdim=True).detach()
        self.stdev = torch.sqrt(torch.var(x, dim=dim2reduce, keepdim=True, unbiased=False) + self.eps).detach()

    def _normalize(self, x):
        x = x - self.mean
        x = x / self.stdev
        if self.affine:
            x = x * self.affine_weight
            x = x + self.affine_bias
        return x

    def _denormalize(self, x):
        if self.affine:
            x = x - self.affine_bias
            x = x / (self.affine_weight + self.eps * self.eps)
        x = x * self.stdev
        x = x + self.mean
        return x


INIT_ARGS = {
    'num_features': 4,
    'eps': 1e-05,
    'affine': True
}

ARGS = {
    'x': torch.randn(2, 3, 4),
    'mode': 'norm',
    'recalc_stats': True
}

if __name__ == '__main__':
    model = RevIN(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SamePadConv Ran
ran on a synthesized input
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("cb26426b6abfe2d3")
How it ran

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

import torch

INIT_ARGS = {
    'in_channels': 3,
    'out_channels': 4,
    'kernel_size': 5,
    'dilation': 1,
    'groups': 1,
}

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

if __name__ == '__main__':
    from torch import nn
    
    class SamePadConv(nn.Module):
        def __init__(self, in_channels, out_channels, kernel_size, dilation=1, groups=1):
            super().__init__()
            self.receptive_field = (kernel_size - 1) * dilation + 1
            padding = self.receptive_field // 2
            self.conv = nn.Conv1d(in_channels, out_channels, kernel_size, padding=padding, dilation=dilation, groups=groups)
            self.remove = 1 if self.receptive_field % 2 == 0 else 0

        def forward(self, x):
            out = self.conv(x)
            if self.remove > 0:
                out = out[:, :, :-self.remove]
            return out
    
    module = SamePadConv(**INIT_ARGS)
    output = module(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Receptive field: {module.receptive_field}")
    print(f"Remove: {module.remove}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TSEncoder Ran
ran on a synthesized input
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("5ac764d53a53c6ea")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, 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
import torch

INIT_ARGS = {
    'input_dims': 4,
    'output_dims': 8,
    'hidden_dims': 16,
    'depth': 2,
}

ARGS = {
    'x': torch.randn(2, 5, 4),
    'mask': None,
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
contrastive_loss_imp Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("da59efe85eb510fd")
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 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)

# Analyze the function to understand tensor shapes:
# - z1 and z2 are used with shape (bs, ts_len, channels)
# - z2.shape[0] // bs = candset_size (so z2 has bs * candset_size rows)
# - labels indexes into z2 and must be valid indices for candset_size
# - After max_pool1d, tensors become (bs, 1, channels)

bs = 2
ts_len = 3
channels = 4
candset_size = 2

# z1: (bs, ts_len, channels) = (2, 3, 4)
z1 = torch.randn(bs, ts_len, channels)

# z2: (bs * candset_size, channels) after pooling becomes (bs * candset_size, 1, channels)
# But before pooling in contrastive_loss_imp, z2 needs to be (bs * candset_size, ts_len, channels)
z2 = torch.randn(bs * candset_size, ts_len, channels)

# labels: for each batch element, index into candset_size options
# In instance_contrastive_loss_imp: labels[batch_idx] * bs + batch_idx indexes z2
# In temporal_contrastive_loss_imp: labels[batch_idx] indexes into candset_size
labels = torch.tensor([0, 1])

tau = 1.0
alpha = 0.5

ARGS = {
    "z1": z1,
    "z2": z2,
    "labels": labels,
    "tau": tau,
    "alpha": alpha,
}
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 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
instance_contrastive_loss_imp Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("52094c3be8d651d0")
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 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)

# Analyze the function to understand required shapes:
# z1: shape (bs, ts_len, channels) - reshaped to (1, ts_len*channels)
# z2: shape (candset_size*bs, ts_len*channels) - indexed by labels[batch_idx]*bs + batch_idx
# labels: shape (bs,) with values in range [0, candset_size)

bs = 2
ts_len = 3
channels = 4
candset_size = 2

# z1: (bs, ts_len, channels) = (2, 3, 4)
z1 = torch.randn(bs, ts_len, channels)

# z2: (candset_size*bs, ts_len, channels) = (4, 3, 4)
# This will be reshaped to (4, 12) when indexed
z2 = torch.randn(candset_size * bs, ts_len, channels)

# labels: (bs,) with values in [0, candset_size)
# For batch_idx in range(bs), we access z2[labels[batch_idx]*bs + batch_idx]
# So labels[0] can be 0 or 1, labels[1] can be 0 or 1
labels = torch.tensor([0, 1])

tau = 1.0

ARGS = {
    "z1": z1,
    "z2": z2,
    "labels": labels,
    "tau": tau,
}
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 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
rebarcrossattn_maskdataset Ran
ran on a synthesized input
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("c36a648ab5d202e3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple, ndim 3, 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
import torch

# Define initialization arguments
INIT_ARGS = {
    'waveforms': np.random.randn(3, 128, 4),  # (batch, time, channels)
    'subseq_size': 32,
    'mask_extended': 16,
    'mask_transient_perc': None,
}

# Define arguments for __getitem__ (the computation method)
ARGS = {
    'idx': 0,
}

METHOD = '__getitem__'

# Construct and call the class
if __name__ == '__main__':
    from rebarcrossattn_maskdataset import rebarcrossattn_maskdataset
    
    # Create dataset instance
    dataset = rebarcrossattn_maskdataset(**INIT_ARGS)
    
    # Call the computation method
    result = dataset(**ARGS)
    
    print(f"Dataset length: {len(dataset)}")
    print(f"Result types: {type(result[0])}, {type(result[1])}")
    print(f"Waveform shape: {result[0].shape}")
    print(f"Mask shape: {result[1].shape}")
    print(f"Mask dtype: {result[1].dtype}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, rebarcrossattn_maskdataset, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
BaseModelClass Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("bdb1d98d6919b1e5")
How it ran

no invocation recorded.

Base_ExpConfig Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("6c78dfb252a62051")
How it ran

no invocation recorded.

REBAR Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("0c1056dec45ae563")
How it ran

no invocation recorded.

REBARCrossAttn_SSLModel Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("afef9af0260b617c")
How it ran

no invocation recorded.

REBAR_CrossAttn_Trainer Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("048bc33d3e7220e9")
How it ran

no invocation recorded.

REBAR_ExpConfig Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("2d001c071ada228b")
How it ran

no invocation recorded.

dilated_conv_block Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("043a6f17d3a20a2f")
How it ran

no invocation recorded.

dilated_conv_net Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("04d4a41a1d4750ea")
How it ran

no invocation recorded.

printlog Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("d9a0d378a8f04f69")
How it ran

no invocation recorded.

temporal_contrastive_loss_imp Not yet run
unverified (harvested, no recorded run)
maxxu05/rebar/models/REBAR/REBAR_SSLModel.py
code served (permissive licence) · get_code("47a35796faef934f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 20 samples lifted from this paper's linked repositories, 20 carry a function identity and 0 do not. Of the 20 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 20 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.

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

The success of self-supervised contrastive learning hinges on identifying positive data pairs, such that when they are pushed together in embedding space, the space encodes useful information for subsequent downstream tasks. Constructing positive pairs is non-trivial as the pairing must be similar enough to reflect a shared semantic meaning, but different enough to capture within-class variation. Classical approaches in vision use augmentations to exploit well-established invariances to construct positive pairs, but invariances in the time-series domain are much less obvious. In our work, we propose a novel method of using a learned measure for identifying positive pairs. Our Retrieval-Based Reconstruction (REBAR) measure measures the similarity between two sequences as the reconstruction error that results from reconstructing one sequence with retrieved information from the other. Then, if the two sequences have high REBAR similarity, we label them as a positive pair. Through validation experiments, we show that the REBAR error is a predictor of mutual class membership. Once integrated into a contrastive learning framework, our REBAR method learns an embedding that achieves state-of-theart performance on downstream tasks across various modalities.

For agents

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

get_harvested_code_for_paper("2311.00519")
get_code_for_paper("2311.00519")
have("2311.00519")

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

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

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

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

Connect an agent — have() is free.