SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.01331 · 2022

Fast Convex Optimization for Two-Layer ReLU Networks: Equivalent Model Classes and Cone Decompositions

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 6 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-21; 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/2202.01331.json · badge: /api/ran/2202.01331.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
pilancilab/scnn canonical (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
FunctionStatusWhere it lives
as_list Ran
ran on a synthesized input
pilancilab/scnn/src/scnn/private/metrics.py
code served (permissive licence) · get_code("fbb92bd2ce42c951")
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
import numpy as np
from typing import Any, List

torch.manual_seed(0)

# Test cases for as_list function
# The function checks if x is iterable and wraps non-iterables in a list

ARGS = {
    "x": "hello"  # string - should be wrapped in a list
}

# Additional test cases to verify the logic works:
test_cases = [
    {"x": "hello"},  # string -> should return ["hello"]
    {"x": 42},  # int (non-iterable) -> should return [42]
    {"x": [1, 2, 3]},  # list (iterable) -> should return [1, 2, 3]
    {"x": (4, 5, 6)},  # tuple (iterable) -> should return (4, 5, 6)
    {"x": torch.tensor([1, 2, 3])},  # tensor (iterable) -> should return tensor
    {"x": np.array([7, 8, 9])},  # numpy array (iterable) -> should return array
    {"x": {"a": 1, "b": 2}},  # dict (iterable) -> should return dict
]

# Verify one works as the main ARGS
ARGS = {"x": "test_string"}
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 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
input_into_normalized_space Ran
ran on a synthesized input
pilancilab/scnn/src/scnn/private/interface/data.py
code served (permissive licence) · get_code("67f2c4b39f8a84c3")
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 numpy as np

torch.manual_seed(0)

# Create model weights tensor with shape (..., d)
# Using shape (2, 4) to represent batch of 2 weight vectors, each of dimension 4
model_weights = torch.randn(2, 4)

# Create column norms vector with shape (d,)
# Must match the last dimension of model_weights
column_norms = torch.randn(4)

ARGS = {
    "model_weights": model_weights,
    "column_norms": column_norms,
}
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 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
merge_metric_lists Ran
ran on a synthesized input
pilancilab/scnn/src/scnn/private/metrics.py
code served (permissive licence) · get_code("9696ab727fb33da9")
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. 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 numpy as np
from typing import Tuple, List, Optional

torch.manual_seed(0)

# The function takes:
# - lm: Tuple[List[str], List[str], List[str]] (required)
# - rm: Optional[Tuple[List[str], List[str], List[str]]] (optional, defaults to None)
# 
# The function body shows it:
# - Returns lm if rm is None
# - Otherwise merges the three lists in each tuple using set union and converts back to lists

# Construct valid arguments
left_metric = (
    ["metric_a", "metric_b", "metric_c"],
    ["loss", "accuracy"],
    ["precision", "recall", "f1"]
)

right_metric = (
    ["metric_b", "metric_d"],
    ["accuracy", "auc"],
    ["recall", "specificity"]
)

ARGS = {
    "lm": left_metric,
    "rm": right_metric
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
sample_dense_gates Ran
ran on a synthesized input
pilancilab/scnn/src/scnn/activations.py
code served (permissive licence) · get_code("b09a9155dbd71322")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (4, 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 numpy as np

# Create a random number generator
rng = np.random.Generator(np.random.PCG64(seed=42))

# Define dimensions
d = 4
n_samples = 2

# Construct arguments dictionary
ARGS = {
    "rng": rng,
    "d": d,
    "n_samples": n_samples
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 2) — shape (4, 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
sample_gate_vectors Ran
ran on a synthesized input
pilancilab/scnn/src/scnn/activations.py
code served (permissive licence) · get_code("1e897d214dde5930")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (10, 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 numpy as np
from numpy.random import Generator

# Create a random number generator with a seed
seed = 42
rng = np.random.default_rng(seed)

# Define parameters for sample_gate_vectors
d = 10  # dimensionality of gate vectors
n_samples = 5  # number of samples
gate_type = 'dense'  # type of gates: 'dense', 'feature_sparse', or 'convolutional'
order = None  # order parameter (used for sparse gates, optional)

ARGS = {
    'seed': seed,
    'd': d,
    'n_samples': n_samples,
    'gate_type': gate_type,
    'order': order
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, typing_extensions — 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 (10, 5) — shape (10, 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
sample_sparse_gates Ran
ran on a synthesized input
pilancilab/scnn/src/scnn/activations.py
code served (permissive licence) · get_code("389f85fd284a2aba")
How it ran

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

import numpy as np
import math

# Set random seed for reproducibility
np.random.seed(0)

# Create a NumPy random number generator
rng = np.random.Generator(np.random.PCG64(seed=42))

# Define parameters
d = 8  # dimensionality of gate vectors
n_samples = 6  # number of samples to use
sparsity_indices = [[0, 1], [2, 3, 4], [5, 6]]  # lists of indices for sparse gates

ARGS = {
    "rng": rng,
    "d": d,
    "n_samples": n_samples,
    "sparsity_indices": sparsity_indices,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (8, 6) — shape (8, 6) 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
format_recent_metrics Not yet run
unverified (harvested, no recorded run)
pilancilab/scnn/src/scnn/private/metrics.py
code served (permissive licence) · get_code("47f4fb6c7ed4492b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 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.

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

Repositories linked to this paper

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

Abstract

We develop fast algorithms and robust software for convex optimization of two-layer neural networks with ReLU activation functions. Our work leverages a convex reformulation of the standard weight-decay penalized training problem as a set of group-$\ell_1$-regularized data-local models, where locality is enforced by polyhedral cone constraints. In the special case of zero-regularization, we show that this problem is exactly equivalent to unconstrained optimization of a convex "gated ReLU" network with non-singular gates. For problems with non-zero regularization, we show that convex gated ReLU models obtain data-dependent approximation bounds for the ReLU training problem. To optimize the convex reformulations, we develop an accelerated proximal gradient method and a practical augmented Lagrangian solver. We show that these approaches are faster than standard training heuristics for the non-convex problem, such as SGD, and outperform commercial interior-point solvers. Experimentally, we verify our theoretical results, explore the group-$\ell_1$ regularization path, and scale convex optimization for neural networks to image classification on MNIST and CIFAR-10.

For agents

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

get_harvested_code_for_paper("2202.01331")
get_code_for_paper("2202.01331")
have("2202.01331")

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

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

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

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

Connect an agent — have() is free.