SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.10100 · NeurIPS · 2023

LenSiam: Self-Supervised Learning on Strong Gravitational Lens Images

Joshua Yao, Yu Lin, Po-Wen Chang, Kuan-Wei Huang, Joshua Fagin, James Hung-Hsu Chan

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-23; 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/2311.10100.json · badge: /api/ran/2311.10100.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
kuanweih/lensiam canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
kuanweih/LenSiam canonical (classifier label)
classifier basis: census
0 ran · 3 no recorded run
FunctionStatusWhere it lives
D Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
kuanweih/lensiam/models/simsiam.py
code served (permissive licence) · get_code("def8badf3c93e6c8")
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 with distinct dimensions
# p and z are used in cosine similarity computation
# They need to have compatible shapes for the operations in the function
p = torch.randn(2, 4)  # batch_size=2, feature_dim=4
z = torch.randn(2, 4)  # same shape as p for cosine_similarity

ARGS = {
    'p': p,
    'z': z,
    'version': 'simplified'
}
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
SimSiam Ran
ran on a synthesized input · constructed an object; no result was computed
kuanweih/lensiam/models/simsiam.py
code served (permissive licence) · get_code("5a8d86f629190099")
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, SimSiam: 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 torchvision.models import resnet50

torch.manual_seed(0)

# Create a minimal backbone that mimics resnet50 interface
class MinimalBackbone(nn.Module):
    def __init__(self, output_dim=2048):
        super().__init__()
        self.output_dim = output_dim
        self.fc = nn.Linear(3, output_dim)
    
    def forward(self, x):
        # x shape: (batch, 3, height, width)
        # Flatten spatial dimensions and pass through fc
        batch_size = x.shape[0]
        x = x.view(batch_size, -1)
        x = self.fc(x)
        return x

# Create backbone instance
backbone = MinimalBackbone(output_dim=2048)

ARGS = {
    'backbone': backbone
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimSiam — 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 SimSiam 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
calc_representations_testset Ran
ran on a synthesized input
kuanweih/lensiam/calc_umap.py
code served (permissive licence) · get_code("73f2575431870404")
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 ndarray, ndim 2, dtype family float, shape (4, 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
import torch.nn as nn
import numpy as np
from argparse import Namespace

torch.manual_seed(0)

# Create a minimal dataset
class MinimalDataset(torch.utils.data.Dataset):
    def __init__(self, num_samples=4):
        self.num_samples = num_samples
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        # Return (image, label) tuple
        image = torch.randn(3, 8, 8)  # 3-channel image
        label = torch.tensor(idx % 2)
        return image, label

# Create a minimal model that returns representations
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(3 * 8 * 8, 16)
    
    def forward(self, x):
        # Flatten and return representation
        x = x.view(x.size(0), -1)
        return self.fc(x)

# Create a minimal HuggingFace-style model that returns tuple
class MinimalHFModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(3 * 8 * 8, 16)
    
    def forward(self, x):
        # Return tuple like HuggingFace models do
        x = x.view(x.size(0), -1)
        return (self.fc(x),)

# Create args namespace with required attributes
args = Namespace(
    train=Namespace(
        batch_size=2
    )
)

# Create dataset
dataset = MinimalDataset(num_samples=4)

# Create model
model = MinimalModel()

# Device
device = "cpu"

# Dataset name
name = "test_dataset"

# Flag for HuggingFace model
flag_hugginface_model = False

ARGS = {
    "dataset": dataset,
    "model": model,
    "args": args,
    "device": device,
    "name": name,
    "flag_hugginface_model": flag_hugginface_model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 16) — shape (4, 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: none by the harness; any seed is in the setup block
prediction_MLP Ran
ran on a synthesized input · constructed an object; no result was computed
kuanweih/lensiam/models/simsiam.py
code served (permissive licence) · get_code("a7c3e42bae03ff81")
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, prediction_MLP: 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 = {
    "in_dim": 2048,
    "hidden_dim": 512,
    "out_dim": 2048,
}
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 prediction_MLP — 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 prediction_MLP 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
projection_MLP Ran
ran on a synthesized input · constructed an object; no result was computed
kuanweih/lensiam/models/simsiam.py
code served (permissive licence) · get_code("98b3137575de1164")
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, projection_MLP: 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 = {
    "in_dim": 4,
    "hidden_dim": 2048,
    "out_dim": 2048,
}
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 projection_MLP — 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 projection_MLP 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
get_2022_lens_geoff Not yet run
unverified (harvested, no recorded run)
kuanweih/LenSiam/datasets/umap_testsets.py
code served (permissive licence) · get_code("804b21ed30af9ab5")
How it ran

no invocation recorded.

get_real_hst Not yet run
unverified (harvested, no recorded run)
kuanweih/LenSiam/datasets/umap_testsets.py
code served (permissive licence) · get_code("394335aacae69cd8")
How it ran

no invocation recorded.

get_stl10 Not yet run
unverified (harvested, no recorded run)
kuanweih/LenSiam/datasets/umap_testsets.py
code served (permissive licence) · get_code("73490b5ff6960373")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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
D
brick of this paper's assembly: loss
5 other papers
3 dated earlier, 2 later
2011.10566 (2020-11)
Exploring Simple Siamese Representation Learning
2105.00470 (2021-05)
On Feature Decorrelation in Self-Supervised Learning
2110.08406 (2021-10)
Surrogate- and invariance-boosted contrastive learning for data-scarce applications in science
and 2 more not named here

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-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Self-supervised learning has been known for learning good representations from data without the need for annotated labels. We explore the simple siamese (Sim-Siam) architecture for representation learning on strong gravitational lens images. Commonly used image augmentations tend to change lens properties; for example, zoom-in would affect the Einstein radius. To create image pairs representing the same underlying lens model, we introduce a lens augmentation method to preserve lens properties by fixing the lens model while varying the source galaxies. Our research demonstrates this lens augmentation works well with SimSiam for learning the lens image representation without labels, so we name it LenSiam. We also show that a pre-trained LenSiam model can benefit downstream tasks. We open-source our code and datasets at https://github.com/kuanweih/LenSiam .

For agents

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

get_harvested_code_for_paper("2311.10100")
get_code_for_paper("2311.10100")
have("2311.10100")

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

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

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

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

Connect an agent — have() is free.