SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.10474 · ICLR · 2024

LDReg: Local Dimensionality Regularized Self-Supervised Learning

James Bailey, Xingjun Ma, Hanxun Huang, Sarah Erfani, Ricardo Campello, Michael Houle

arXiv · PDF · Open in the Atlas

Code that ran

20 of 36 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 1 violated it and 7 have no contract verdict; 8 failures of our instrument; 16 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/2401.10474.json · badge: /api/ran/2401.10474.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
JoJoNing25/DDAug community
Papers with Code archive
15 ran · 15 no recorded run
HanxunH/LDReg marked official in Papers with Code
Papers with Code archive
5 ran · 1 no recorded run
FunctionStatusWhere it lives
FullGatherLayer Ran
ran on a synthesized input · constructed an object; no result was computed
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("efbec016cf3c4e21")
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, FullGatherLayer: 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.distributed as dist
from unittest.mock import MagicMock, patch

torch.manual_seed(0)

# Mock distributed training setup
class MockDistributed:
    def __init__(self, rank=0, world_size=2):
        self.rank = rank
        self.world_size = world_size
    
    def get_rank(self):
        return self.rank
    
    def get_world_size(self):
        return self.world_size
    
    def all_gather(self, output_list, tensor):
        # Simulate all_gather by filling output list with the input tensor
        for i in range(len(output_list)):
            output_list[i].copy_(tensor)
    
    def all_reduce(self, tensor):
        # Simulate all_reduce by summing (in this mock, just scale by world_size)
        tensor.mul_(self.world_size)

# Patch dist module functions
mock_dist = MockDistributed(rank=0, world_size=2)

def mock_get_world_size():
    return mock_dist.get_world_size()

def mock_get_rank():
    return mock_dist.get_rank()

def mock_all_gather(output_list, tensor):
    return mock_dist.all_gather(output_list, tensor)

def mock_all_reduce(tensor):
    return mock_dist.all_reduce(tensor)

# Apply patches
with patch.object(dist, 'get_world_size', mock_get_world_size):
    with patch.object(dist, 'get_rank', mock_get_rank):
        with patch.object(dist, 'all_gather', mock_all_gather):
            with patch.object(dist, 'all_reduce', mock_all_reduce):
                # Create input tensor for FullGatherLayer.forward
                x = torch.randn(2, 4)
                
                ARGS = {
                    'x': x
                }
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 FullGatherLayer — 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 FullGatherLayer 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
GrayLayer Ran
ran on a synthesized input · constructed an object; no result was computed
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("d03096e93a9cffcc")
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, GrayLayer: 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
from torch import nn

torch.manual_seed(0)

def _gray(img: torch.Tensor) -> torch.Tensor:
    r, g, b = img.chunk(3, dim=1)
    return 0.299 * r + 0.587 * g + 0.11 * b

class GrayLayer(nn.Module):

    def __init__(self):
        super(GrayLayer, self).__init__()

    def forward(self, x):
        return _gray(x).repeat(1, 3, 1, 1)

    def _sample(self):
        return ('Gray', None)

    def _get_params(self):
        return None

# Create an instance of GrayLayer
gray_layer = GrayLayer()

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 GrayLayer — 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 GrayLayer 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
IdentityLayer Ran
ran on a synthesized input · constructed an object; no result was computed
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("dcb240bf1416737e")
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, IdentityLayer: 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 = {}
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 IdentityLayer — 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 IdentityLayer 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
NTXentBase Ran
ran on a synthesized input · constructed an object; no result was computed
HanxunH/LDReg/losses/ntxent_lid_reg.py
code served (permissive licence) · get_code("f3d6a6be48cdb9e9")
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, NTXentBase: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np

torch.manual_seed(0)

ARGS = {
    "temperature": 0.5,
    "gather_distributed": False,
    "dim_norm": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NTXentBase — 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 NTXentBase 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
_STE Ran
ran on a synthesized input · constructed an object; no result was computed
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("0948c0465513c79d")
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, _STE: 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
from torch.autograd import Function

torch.manual_seed(0)

# Analyze what the function needs:
# - forward(ctx, input_forward, input_backward): 
#   - input_forward: returned as-is
#   - input_backward: its shape is stored in ctx
# - backward(ctx, grad_in):
#   - grad_in: gradient tensor that gets sum_to_size'd to ctx.shape
#
# So we need two tensors with potentially different shapes
# input_forward can be any shape, input_backward shape will be used as target

input_forward = torch.randn(2, 4)
input_backward = torch.randn(2, 3)

ARGS = {
    "input_forward": input_forward,
    "input_backward": input_backward,
}
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 _STE — 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 _STE 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
_blend_image Ran
ran, honoured the contract we drafted
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("3bccd0b613b2ec94")
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 4, dtype family float, shape (2, 3, 4, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# img1 and img2 are image tensors with shape (batch, channels, height, width)
# alpha is a tensor with shape (batch,) that will be reshaped to (batch, 1, 1, 1)
img1 = torch.rand(2, 3, 4, 5)  # batch=2, channels=3, height=4, width=5
img2 = torch.rand(2, 3, 4, 5)  # same shape as img1
alpha = torch.tensor([0.3, 0.7])  # batch size 2, values in [0, 1]

ARGS = {
    "img1": img1,
    "img2": img2,
    "alpha": alpha,
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_blur Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("00b297b23155ccd0")
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 4, dtype family float, shape (2, 3, 4, 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small image tensor: (batch=2, channels=3, height=4, width=4)
img = torch.randn(2, 3, 4, 4)

# Create a small 2D kernel: (height=3, width=3)
# The function expects kernel.ndim == 2
kernel = torch.randn(3, 3)

ARGS = {
    'img': img,
    'kernel': kernel
}
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 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 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
_gray Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("14a3e0d0584f4f1f")
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 4, dtype family float, shape (2, 1, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small RGB image tensor
# Shape: (batch=2, channels=3, height=4, width=4)
# The function expects img.chunk(3, dim=1) to split channels
img = torch.randn(2, 3, 4, 4)

ARGS = {
    "img": img
}
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 4, dtype family float, shape (2, 1, 4, 4) — shape (2, 1, 4, 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
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HanxunH/LDReg/losses/ntxent_lid_reg.py
code served (permissive licence) · get_code("e8d9c82a15ba2a57")
How it ran

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

import torch

torch.manual_seed(0)

# The function expects:
# - output: a tensor with shape (batch_size, num_classes) that supports .topk() method
# - target: a tensor with shape (batch_size,) containing class indices
# - topk: tuple of integers specifying which top-k accuracies to compute

batch_size = 2
num_classes = 4

# Create output tensor (logits/scores from model)
# Shape: (batch_size, num_classes)
output = torch.randn(batch_size, num_classes)

# Create target tensor (ground truth class indices)
# Shape: (batch_size,)
target = torch.tensor([0, 2])

# topk parameter - compute top-1 and top-2 accuracies
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
activation Ran
ran, honoured the contract we drafted
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("cd6af889cd96c427")
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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes a single parameter 'x' which should be a tensor
# It applies tanh, adds 1, divides by 2 (normalization to [0, 1])
# So x should be a torch tensor of any shape

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
eye_rank Ran
ran, violated the contract we drafted
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("4593546c432138ea")
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 2, dtype family float, shape (3, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.distributed as dist

torch.manual_seed(0)

# Setup for distributed training simulation
# Since we're not actually initializing distributed training,
# the functions will use the non-distributed paths (rank=0, world_size=1)

ARGS = {
    "n": 3,
    "device": None,
}
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 2, dtype family float, shape (3, 3) — shape (3, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gather Ran
ran; our contract draft was wrong, not the code
HanxunH/LDReg/losses/ntxent_lid_reg.py
code served (permissive licence) · get_code("cf0782bfe6eddbac")
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 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.distributed as dist

# Mock the distributed module for CPU-only testing
class MockDistributed:
    def __init__(self):
        self._world_size = 2
        self._rank = 0
    
    def get_world_size(self):
        return self._world_size
    
    def get_rank(self):
        return self._rank
    
    def all_gather(self, output_list, input_tensor):
        # Simulate gathering: fill output list with copies of input
        for i in range(len(output_list)):
            output_list[i].copy_(input_tensor)
    
    def all_reduce(self, tensor):
        # Simulate all_reduce: just sum across the first dimension
        pass

# Replace dist with our mock
dist.get_world_size = MockDistributed().get_world_size
dist.get_rank = MockDistributed().get_rank
dist.all_gather = MockDistributed().all_gather
dist.all_reduce = MockDistributed().all_reduce

torch.manual_seed(0)

# Create a small input tensor (batch=2, dim=4)
input_tensor = torch.randn(2, 4)

ARGS = {
    "input": input_tensor
}
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 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: none by the harness; any seed is in the setup block
get_sharpness_kernel Ran
ran, honoured the contract we drafted
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("a77358b38f7eb68c")
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 2, dtype family float, shape (3, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "device": torch.device("cpu")
}
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 2, dtype family float, shape (3, 3) — shape (3, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
lid_mle Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("397aafa38e8e9bfa")
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 1, dtype family float, shape (2,) 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 data and reference
# data: shape (2, 4) - 2 samples, 4 features
data = torch.randn(2, 4)

# reference: shape (3, 4) - 3 reference samples, 4 features
reference = torch.randn(3, 4)

# k parameter - number of nearest neighbors
k = 2

# get_idx parameter - whether to return indices
get_idx = False

ARGS = {
    "data": data,
    "reference": reference,
    "k": k,
    "get_idx": get_idx,
}
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 1, dtype family float, shape (2,) — shape (2,) 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
lid_mle Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HanxunH/LDReg/losses/ntxent_lid_reg.py
code served (permissive licence) · get_code("9d8f2e35d4702814")
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 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for data and reference
# data and reference are flattened to 2D tensors inside the function
# We need b >= k+1 for the function to work (k is adjusted to min(k, b-2))
# Let's use b=5 (batch size) with 4-dimensional flattened features
data = torch.randn(5, 4)
reference = torch.randn(6, 4)

ARGS = {
    'data': data,
    'reference': reference,
    'k': 3,
    'get_idx': False,
    'compute_mode': 'use_mm_for_euclid_dist_if_necessary'
}
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 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
lid_mom_est Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HanxunH/LDReg/losses/ntxent_lid_reg.py
code served (permissive licence) · get_code("918cecffdec2a619")
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 1, dtype family float, shape (2,) 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 data and reference
# data: batch_size=2, flattened_dim=4
data = torch.randn(2, 4)

# reference: batch_size=3, flattened_dim=4 (distinct size for reference batch)
reference = torch.randn(3, 4)

# k: number of nearest neighbors to consider
k = 2

# get_idx: whether to return indices along with lids
get_idx = False

# compute_mode: optimization mode for cdist
compute_mode = 'use_mm_for_euclid_dist_if_necessary'

ARGS = {
    'data': data,
    'reference': reference,
    'k': k,
    'get_idx': get_idx,
    'compute_mode': compute_mode
}
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 1, dtype family float, shape (2,) — shape (2,) 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
rank Ran
ran on a synthesized input
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("a38b33a0219b2651")
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 int, ndim 0, dtype family int, 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.distributed as dist

torch.manual_seed(0)

# The rank() function takes no parameters
# It either calls dist.get_rank() if dist is initialized, or returns 0
# We don't need to initialize the distributed environment for this to work
# since the function handles the case where dist is not initialized

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 int, ndim 0, dtype family int, 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
ste Ran
ran, honoured the contract we drafted
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("f8ccb18e75fab7db")
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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.autograd import Function

torch.manual_seed(0)

# The ste function takes two tensor arguments:
# - input_forward: returned as-is in forward pass
# - input_backward: used in backward pass, its shape is stored in ctx
# The backward method calls grad_in.sum_to_size(ctx.shape), so input_backward
# needs a shape that sum_to_size can broadcast to/from

# Create two tensors with different shapes to test the functionality
input_forward = torch.randn(2, 4, requires_grad=True)
input_backward = torch.randn(2, 4, 3, requires_grad=True)

ARGS = {
    "input_forward": input_forward,
    "input_backward": input_backward,
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tensor_function Ran
ran; our contract draft was wrong, not the code
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("229e3f0e1a7ceb04")
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 function. 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 functools

def tensor_function(func):

    @functools.wraps(func)
    def inner(*args):
        if len(args) == 1:
            img = args[0]
            mag = None
        elif len(args) == 2:
            img, mag = args
        else:
            img, mag, kernel = args
        if not torch.is_tensor(img):
            raise RuntimeError(f'img is expected to be torch.Tensor, but got {type(img)} instead')
        if img.dim() == 3:
            img = img.unsqueeze(0)
        if torch.is_tensor(mag) and mag.nelement() != 1 and (mag.size(0) != img.size(0)):
            raise RuntimeError('Shape of `mag` is expected to be `1` or `B`')
        out = func(img, mag, kernel) if len(args) == 3 else func(img, mag)
        return out.clamp_(0, 1)
    return inner

torch.manual_seed(0)

# Define the decorated function that will be called
@tensor_function
def sample_func(img, mag, kernel=None):
    return img * 0.5

# Create test tensors
batch_size = 2
channels = 3
height = 4
width = 5

# Create image tensor (B, C, H, W)
img_tensor = torch.rand(batch_size, channels, height, width)

# Create magnitude tensor with matching batch size
mag_tensor = torch.rand(batch_size)

# Create kernel tensor
kernel_tensor = torch.rand(3, 3)

ARGS = {
    "func": sample_func,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
world_size Ran
ran on a synthesized input
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("a1d11ea20c97a5b5")
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 int, ndim 0, dtype family int, 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.distributed as dist

torch.manual_seed(0)

# The function world_size() takes no parameters
# It calls dist.get_world_size() if dist.is_initialized() else returns 1
# Since we're not setting up actual distributed training, 
# dist.is_initialized() will return False and the function will return 1

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 int, ndim 0, dtype family int, 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
AugLayer Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("8758e55ff0b748ef")
How it ran

no invocation recorded.

AugPolicy Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("99feec893219b44d")
How it ran

no invocation recorded.

BrightnessLayer Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("5872bbeca7913d9c")
How it ran

no invocation recorded.

ContrastLayer Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("c566f6618abd39ed")
How it ran

no invocation recorded.

GaussianBlurLayer Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("83b86abab1e05654")
How it ran

no invocation recorded.

HueLayer Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("057cf4bcc8260a07")
How it ran

no invocation recorded.

NTXentLIDReg Not yet run
unverified (harvested, no recorded run)
HanxunH/LDReg/losses/ntxent_lid_reg.py
code served (permissive licence) · get_code("0cfb402f67dc5765")
How it ran

no invocation recorded.

NTXentLossLIDAug Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("5887614dd9999cbd")
How it ran

no invocation recorded.

PosterizeLayer Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("712473be9274437d")
How it ran

no invocation recorded.

SaturationLayer Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("c2f2a5f8fcf3adac")
How it ran

no invocation recorded.

SharpnessLayer Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("7b025f0f036c7b4c")
How it ran

no invocation recorded.

SolarizeLayer Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("ef94ac6f4485c581")
How it ran

no invocation recorded.

full_gather Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("18ac34711a665335")
How it ran

no invocation recorded.

posterize Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("01c6078e675ae833")
How it ran

no invocation recorded.

sharpness Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("959973c5950dd3fb")
How it ran

no invocation recorded.

solarize Not yet run
unverified (harvested, no recorded run)
JoJoNing25/DDAug/losses/ntxent_lidaug.py
code served (permissive licence) · get_code("8000f04f9e183df4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 36 samples lifted from this paper's linked repositories, 36 carry a function identity and 0 do not. Of the 36 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 32 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
FullGatherLayer
brick of this paper's assembly: helper
3 other papers
3 dated earlier · 2 only as an assembly brick
2105.04906 (2021-05)
VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learning
2210.01571 (2022-10)
VICRegL: Self-Supervised Learning of Local Visual Features
2305.16789 (2023-05)
Modulate Your Spectrum in Self-Supervised Learning
world_size
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 2 only as an assembly brick
2105.04906 (2021-05)
VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learning
2210.01571 (2022-10)
VICRegL: Self-Supervised Learning of Local Visual Features
accuracy
brick of this paper's assembly: helper
1 other paper
1 later
2409.02483 (2024-09)
TASAR: Transfer-based Attack on Skeletal Action Recognition
tensor_function
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1911.06987 (2019-11)
Faster AutoAugment: Learning Augmentation Strategies using Backpropagation

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

Representations learned via self-supervised learning (SSL) can be susceptible to dimensional collapse, where the learned representation subspace is of extremely low dimensionality and thus fails to represent the full data distribution and modalities. Dimensional collapse ---also known as the "underfilling" phenomenon --is one of the major causes of degraded performance on downstream tasks. Previous work has investigated the dimensional collapse problem of SSL at a global level. In this paper, we demonstrate that representations can span over high dimensional space globally, but collapse locally. To address this, we propose a method called local dimensionality regularization (LDReg). Our formulation is based on the derivation of the Fisher-Rao metric to compare and optimize local distance distributions at an asymptotically small radius for each data point. By increasing the local intrinsic dimensionality, we demonstrate through a range of experiments that LDReg improves the representation quality of SSL. The results also show that LDReg can regularize dimensionality at both local and global levels.

For agents

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

get_harvested_code_for_paper("2401.10474")
get_code_for_paper("2401.10474")
have("2401.10474")

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

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

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

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

Connect an agent — have() is free.