SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1907.12207 · 2019

LassoNet: A Neural Network with Feature Sparsity

arXiv · PDF · Open in the Atlas

Code that ran

6 of 13 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; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 2 failures of our instrument; 7 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/1907.12207.json · badge: /api/ran/1907.12207.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
ilemhadri/lassoNet canonical (classifier label)
classifier basis: census
6 ran · 7 no recorded run
FunctionStatusWhere it lives
abstractattr Ran
ran on a synthesized input
ilemhadri/lassoNet/lassonet/interfaces.py
code served (permissive licence) · get_code("6d28f3f15d6b4442")
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 property. 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 abc import ABCMeta, abstractmethod

def abstractattr(f):
    return property(abstractmethod(f))

# The function 'abstractattr' takes a single parameter 'f' which should be a callable (function).
# It wraps the function with property(abstractmethod(f)) to create an abstract property.
# To call this function, we need to pass a callable.

def sample_method(self):
    """A sample method to be used as an abstract property."""
    pass

ARGS = {
    "f": sample_method
}
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 property — a property output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a property 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
eval_on_path Ran
ran on a synthesized input
ilemhadri/lassoNet/lassonet/utils.py
code served (permissive licence) · get_code("c978e6818ea01805")
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 torch.nn as nn

torch.manual_seed(0)

# Create a simple model that has load, score, and predict methods
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self._state = None
    
    def forward(self, x):
        return self.linear(x)
    
    def predict(self, X):
        with torch.no_grad():
            return self.forward(X)
    
    def score(self, X_test, y_test):
        predictions = self.predict(X_test)
        # Simple MSE-based score
        return -((predictions - y_test) ** 2).mean().item()
    
    def load(self, state_dict):
        self.load_state_dict(state_dict)

# Create model instance
model = SimpleModel()

# Create test data
X_test = torch.randn(2, 4)
y_test = torch.randn(2, 3)

# Create a path with SavePoint-like objects that have state_dict attribute
class SavePoint:
    def __init__(self, model):
        self.state_dict = model.state_dict()

# Create several checkpoints along a path
path = [
    SavePoint(model),
    SavePoint(model),
    SavePoint(model),
]

# Custom score function for testing
def custom_score(y_true, y_pred):
    return -((y_true - y_pred) ** 2).mean().item()

ARGS = {
    "model": model,
    "path": path,
    "X_test": X_test,
    "y_test": y_test,
    "score_function": custom_score,
}
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
make_writable Ran
ran on a synthesized input
ilemhadri/lassoNet/lassonet/r.py
code served (permissive licence) · get_code("1a8970e7e4a34bcb")
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 int, 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 numpy as np

# Create a simple numpy array to test
test_array = np.array([[1, 2, 3, 4],
                       [5, 6, 7, 8]])

ARGS = {
    "x": test_array
}
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 int, 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
prox Ran
ran; our contract draft was wrong, not the code
ilemhadri/lassoNet/lassonet/prox.py
code served (permissive licence) · get_code("feaf95baefd799b5")
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

torch.manual_seed(0)

# The function prox takes parameters: v, u, lambda_, lambda_bar, M
# v has shape (m,) or (m, batches)
# u has shape (k,) or (k, batches)
# lambda_, lambda_bar, M are scalars

# Create test tensors with distinct dimensions
m = 4  # dimension for v
k = 3  # dimension for u
batches = 2

# Create v with shape (m, batches)
v = torch.randn(m, batches)

# Create u with shape (k, batches)
u = torch.randn(k, batches)

# Create scalar hyperparameters
lambda_ = 0.5
lambda_bar = 0.1
M = 2.0

ARGS = {
    "v": v,
    "u": u,
    "lambda_": lambda_,
    "lambda_bar": lambda_bar,
    "M": M,
}
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 — 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
sign_binary Ran
ran; our contract draft was wrong, not the code
ilemhadri/lassoNet/lassonet/prox.py
code served (permissive licence) · get_code("72eb093eb143edd8")
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 sign_binary takes a single parameter x
# It expects x to be a torch tensor since it uses torch operations on it
# Creating a small tensor with distinct dimensions (2 x 4)
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
soft_threshold Ran
ran, honoured the contract we drafted
ilemhadri/lassoNet/lassonet/prox.py
code served (permissive licence) · get_code("3f9208771cec0b61")
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)

# soft_threshold takes two parameters:
# l: a threshold value (scalar)
# x: a tensor to apply soft thresholding to

l = 0.5
x = torch.randn(2, 4)

ARGS = {
    "l": l,
    "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
lassonet_eval Not yet run
unverified (harvested, no recorded run)
ilemhadri/lassoNet/lassonet/r.py
code served (permissive licence) · get_code("3e948e6f3b10a45a")
How it ran

no invocation recorded.

lassonet_path Not yet run
unverified (harvested, no recorded run)
ilemhadri/lassoNet/lassonet/r.py
code served (permissive licence) · get_code("7868c5292dc4787e")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
ilemhadri/lassoNet/experiments/data_utils.py
code served (permissive licence) · get_code("ebb17c927b326e18")
How it ran

no invocation recorded.

load_mice Not yet run
unverified (harvested, no recorded run)
ilemhadri/lassoNet/experiments/data_utils.py
code served (permissive licence) · get_code("92305d8388541e0e")
How it ran

no invocation recorded.

load_mnist_two_digits Not yet run
unverified (harvested, no recorded run)
ilemhadri/lassoNet/experiments/data_utils.py
code served (permissive licence) · get_code("9301354d553d2c5c")
How it ran

no invocation recorded.

log_substract Not yet run
unverified (harvested, no recorded run)
ilemhadri/lassoNet/lassonet/utils.py
code served (permissive licence) · get_code("f8a4a258e2118d30")
How it ran

no invocation recorded.

scatter_logsumexp Not yet run
unverified (harvested, no recorded run)
ilemhadri/lassoNet/lassonet/utils.py
code served (permissive licence) · get_code("4ba51cbf2fe87c3f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 10 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
prox 1 other paper
1 later
2211.06302 (2022-11)
GCondNet: A Novel Method for Improving Neural Networks on Small High-Dimensional Tabular Data
sign_binary 1 other paper
1 later
2211.06302 (2022-11)
GCondNet: A Novel Method for Improving Neural Networks on Small High-Dimensional Tabular Data
soft_threshold 1 other paper
1 later
2211.06302 (2022-11)
GCondNet: A Novel Method for Improving Neural Networks on Small High-Dimensional Tabular Data

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

Much work has been done recently to make neural networks more interpretable, and one obvious approach is to arrange for the network to use only a subset of the available features. In linear models, Lasso (or $\ell_1$-regularized) regression assigns zero weights to the most irrelevant or redundant features, and is widely used in data science. However the Lasso only applies to linear models. Here we introduce LassoNet, a neural network framework with global feature selection. Our approach enforces a hierarchy: specifically a feature can participate in a hidden unit only if its linear representative is active. Unlike other approaches to feature selection for neural nets, our method uses a modified objective function with constraints, and so integrates feature selection with the parameter learning directly. As a result, it delivers an entire regularization path of solutions with a range of feature sparsity. On systematic experiments, LassoNet significantly outperforms state-of-the-art methods for feature selection and regression. The LassoNet method uses projected proximal gradient descent, and generalizes directly to deep networks. It can be implemented by adding just a few lines of code to a standard neural network.

For agents

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

get_harvested_code_for_paper("1907.12207")
get_code_for_paper("1907.12207")
have("1907.12207")

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

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

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

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

Connect an agent — have() is free.