SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2204.03640 · 2022

Equivariance Discovery by Learned Parameter-Sharing

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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 7 have no contract verdict; 0 failures of our instrument; 1 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/2204.03640.json · badge: /api/ran/2204.03640.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
raymondyeh07/equivariance_discovery canonical (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
FunctionStatusWhere it lives
adj_to_set Ran
ran on a synthesized input
raymondyeh07/equivariance_discovery/struct_discovery/evaluation/partition_distance.py
code served (permissive licence) · get_code("12d3e9b47201fb33")
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 numpy as np

# Construct a valid adjacency matrix A
# The function expects A to be a 2D array where:
# - num_obj (rows) = number of objects
# - num_cluster (columns) = number of clusters
# Each row should contain values that can be compared with argmax

num_obj = 5
num_cluster = 3

# Create a simple adjacency matrix with shape (5, 3)
# Each row represents an object, each column represents a cluster
# The values represent some kind of affinity/assignment score
A = np.array([
    [0.9, 0.1, 0.0],
    [0.1, 0.8, 0.1],
    [0.2, 0.1, 0.7],
    [0.6, 0.3, 0.1],
    [0.0, 0.5, 0.5]
], dtype=np.float32)

ARGS = {
    "A": A
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
build_optimizer Ran
ran on a synthesized input
raymondyeh07/equivariance_discovery/struct_discovery/solver/build.py
code served (permissive licence) · get_code("5fcd7bebf475984d")
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 Adam. 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)

# Build a small model with parameters to optimize
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Create config dict (used as cfg parameter)
cfg = {
    'learning_rate': 0.01,
    'optimizer': 'ADAM'
}

# Get model parameters to optimize
opt_param = model.parameters()

ARGS = {
    'cfg': cfg,
    'opt_param': opt_param,
    'lr': 0.01,
    'opt_name': 'ADAM'
}
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 Adam — a Adam output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adam 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
compute_grad Ran
ran on a synthesized input
raymondyeh07/equivariance_discovery/struct_discovery/solver/hypergrad/grad_helpers.py
code served (permissive licence) · get_code("d8fe2cddae8305b3")
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 (15, 1) 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 grad

torch.manual_seed(0)

# Define a minimal model that satisfies the function's requirements
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.layer(x)
    
    def hyper_parameters(self):
        # Return a tuple of parameters (for structure=True case)
        return tuple(self.parameters())
    
    def model_parameters(self):
        # Return a tuple of parameters (for structure=False case)
        return tuple(self.parameters())
    
    def total_loss(self, y_pred, y):
        # Training loss
        return nn.functional.mse_loss(y_pred, y)
    
    def total_val_loss(self, y_pred, y):
        # Validation loss
        return nn.functional.mse_loss(y_pred, y)

# Create model instance
model = SimpleModel()

# Create batch data: (x, y) tuple with small tensors
# x: batch_size=2, input_dim=4
# y: batch_size=2, output_dim=3
x = torch.randn(2, 4, requires_grad=True)
y = torch.randn(2, 3)
batch_data = (x, y)

ARGS = {
    'batch_data': batch_data,
    'model': model,
    'structure': True,
    'create_graph': False,
    'retain_graph': False,
    'allow_unused': False,
    'is_train': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (15, 1) — shape (15, 1) 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
conjugate_gradient Ran
ran on a synthesized input
raymondyeh07/equivariance_discovery/struct_discovery/solver/hypergrad/conjugate_gradient.py
code served (permissive licence) · get_code("a74effb2b7707ed5")
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 (4, 1) 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)

# A is a function that computes matrix-vector product Ax
# Looking at the usage: A(x), A(p), r.T.mm(r), p.T.mm(Ap)
# The function expects A to be callable and work with 2D tensors (for .mm operations)
# We'll create a simple linear operator

def A_operator(x):
    """Linear operator that computes Ax for a simple 4x4 matrix"""
    # Create a simple symmetric positive definite matrix
    matrix = torch.tensor([
        [4.0, 1.0, 0.5, 0.2],
        [1.0, 3.0, 0.3, 0.1],
        [0.5, 0.3, 2.0, 0.4],
        [0.2, 0.1, 0.4, 1.5]
    ])
    # x should be shape (4, 1) for .mm operations
    return matrix.mm(x)

# b is a torch tensor - right hand side of Ax=b
b = torch.tensor([
    [1.0],
    [2.0],
    [3.0],
    [4.0]
])

# x0 is initial guess (optional, can be None)
x0 = torch.zeros(4, 1)

# tol is convergence tolerance
tol = 1e-5

# maxiter is maximum iterations
maxiter = 100

# debug flag
debug = False

ARGS = {
    "A": A_operator,
    "b": b,
    "x0": x0,
    "tol": tol,
    "maxiter": maxiter,
    "debug": debug
}
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 (4, 1) — shape (4, 1) 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
create_small_table Ran
ran on a synthesized input
raymondyeh07/equivariance_discovery/struct_discovery/utils/logger.py
code served (permissive licence) · get_code("97e7a0b81f740d29")
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 str. 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 tabulate import tabulate

# Construct a small dictionary with a few items
# The function will use the keys as headers and values as table row data
small_dict = {
    'loss': 0.5234,
    'accuracy': 0.9876,
    'f1_score': 0.8765,
    'precision': 0.9123
}

ARGS = {
    'small_dict': small_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tabulate, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
flatten_param Ran
ran on a synthesized input
raymondyeh07/equivariance_discovery/struct_discovery/solver/hypergrad/grad_helpers.py
code served (permissive licence) · get_code("e60116082061e5d2")
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 (25, 1) 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 expects 'param' to be an iterable of tensors
# It calls .view(-1, 1) on each element and concatenates them
# So param should be a list/tuple of tensors

param = [
    torch.randn(4, 3),
    torch.randn(2, 5),
    torch.randn(3, 1)
]

ARGS = {
    "param": param
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (25, 1) — shape (25, 1) 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
partition_distance Ran
ran on a synthesized input
raymondyeh07/equivariance_discovery/struct_discovery/evaluation/partition_distance.py
code served (permissive licence) · get_code("6950cdac4f703761")
How it ran

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

import numpy as np
from scipy.optimize import linear_sum_assignment

# Create two adjacency/assignment matrices
# A1: 5 objects, 3 clusters
# A2: 5 objects, 4 clusters
# Each row represents an object, columns represent cluster assignments
# Values can be arbitrary (function uses argmax)

A1 = np.array([
    [0.9, 0.05, 0.05],
    [0.1, 0.8, 0.1],
    [0.2, 0.2, 0.6],
    [0.7, 0.2, 0.1],
    [0.3, 0.3, 0.4]
])

A2 = np.array([
    [0.8, 0.1, 0.05, 0.05],
    [0.1, 0.7, 0.1, 0.1],
    [0.2, 0.3, 0.4, 0.1],
    [0.6, 0.2, 0.1, 0.1],
    [0.2, 0.2, 0.3, 0.3]
])

ARGS = {
    "A1": A1,
    "A2": A2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
my_jacobian Not yet run
unverified (harvested, no recorded run)
raymondyeh07/equivariance_discovery/struct_discovery/solver/hypergrad/grad_helpers.py
code served (permissive licence) · get_code("06006c69cb12afb4")
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, 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 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

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

Designing equivariance as an inductive bias into deep-nets has been a prominent approach to build effective models, e.g., a convolutional neural network incorporates translation equivariance. However, incorporating these inductive biases requires knowledge about the equivariance properties of the data, which may not be available, e.g., when encountering a new domain. To address this, we study how to discover interpretable equivariances from data. Specifically, we formulate this discovery process as an optimization problem over a model's parameter-sharing schemes. We propose to use the partition distance to empirically quantify the accuracy of the recovered equivariance. Also, we theoretically analyze the method for Gaussian data and provide a bound on the mean squared gap between the studied discovery scheme and the oracle scheme. Empirically, we show that the approach recovers known equivariances, such as permutations and shifts, on sum of numbers and spatially-invariant data.

For agents

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

get_harvested_code_for_paper("2204.03640")
get_code_for_paper("2204.03640")
have("2204.03640")

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

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

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

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

Connect an agent — have() is free.