SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.03583 · NeurIPS · 2022

pyGSL: A Graph Structure Learning Toolkit

Max Wasserman, Gonzalo Mateos

arXiv · PDF · Open in the Atlas

Code that ran

10 of 11 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 10 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/2211.03583.json · badge: /api/ran/2211.03583.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
maxwass/pyGSL canonical (classifier label)
classifier basis not recorded on the link
10 ran · 1 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/misc/metrics.py
code served (permissive licence) · get_code("e7eeeef866a8af21")
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 float, 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 numpy as np

torch.manual_seed(0)

# The function accuracy(tp, tn, total) simply adds tp and tn, then divides by total.
# All three parameters are numeric values (likely integers or floats representing counts).

tp = 45  # True positives
tn = 30  # True negatives
total = 100  # Total samples

ARGS = {
    "tp": tp,
    "tn": tn,
    "total": total,
}
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 float, 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
all_incorrect_predictions Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/misc/metrics.py
code served (permissive licence) · get_code("55350ed9715690c8")
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 bool, 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

torch.manual_seed(0)

# Analyze the function: all_incorrect_predictions(tp, tn, fp, fn)
# The function compares: fp + fn == tp + tn + fp + fn
# This simplifies to: 0 == tp + tn, which means tp and tn must sum to 0
# Or equivalently: fp + fn == tp + tn + fp + fn means tp + tn must equal 0

# These parameters represent confusion matrix components (True Positives, True Negatives, False Positives, False Negatives)
# They should be numeric values (int or tensor)

# Let's use small integer values that satisfy the equality or not
tp = 5
tn = 3
fp = 2
fn = 1

ARGS = {
    "tp": tp,
    "tn": tn,
    "fp": fp,
    "fn": fn
}
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 bool, 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
edge_density Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/misc/utils.py
code served (permissive licence) · get_code("01d3e9ea5fb275da")
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
import numpy as np

torch.manual_seed(0)

# Test with 3D tensor (batch of adjacency matrices)
batch_size = 2
n = 4
A_3d = torch.randn(batch_size, n, n)

ARGS = {
    "A": A_3d
}
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 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
make_checkpoint_callback_dict Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/misc/train_funcs.py
code served (permissive licence) · get_code("a80520708aaf6030")
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 dict. 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 os
import sys
from datetime import datetime
from pathlib import Path
import tempfile

# Create a temporary directory for this test
temp_dir = tempfile.mkdtemp()
path2currDir = temp_dir + '/'

ARGS = {
    'path2currDir': path2currDir,
    'monitor': 'val/error/mean',
    'mode': 'min',
    'task': 'classification',
    'loss': 'cross_entropy',
    'which_exp': 'real_experiment_v1',
    'rand_seed': 42,
    'run_directory': 'run_2024_01_15',
    'misc': 'baseline',
    'subnets': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
network_deconvolution Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/models/model_based/network_deconvolution/network_deconvolution.py
code served (permissive licence) · get_code("1291bd7a357bf4d9")
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 3, dtype family float, shape (2, 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 numpy as np

torch.manual_seed(0)

# Create a small symmetric positive definite matrix for testing
# Shape: (batch_size, N, N) where N == N1
batch_size = 2
N = 4

# Create random symmetric positive definite matrices
x_list = []
for _ in range(batch_size):
    # Create a random matrix and make it symmetric positive definite
    random_mat = torch.randn(N, N)
    sym_mat = random_mat @ random_mat.T  # This ensures positive semi-definite
    sym_mat = sym_mat + torch.eye(N) * 0.1  # Add small positive value to diagonal for stability
    x_list.append(sym_mat)

x = torch.stack(x_list)  # Shape: (2, 4, 4)

alpha = 1.0

ARGS = {
    "x": x,
    "alpha": alpha,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 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
perfect_predictions Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/misc/metrics.py
code served (permissive licence) · get_code("ce3d3efcb85593e5")
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 bool, 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 numpy as np

torch.manual_seed(0)

# The function perfect_predictions checks if tp + tn == tp + tn + fp + fn
# This is true only when fp + fn == 0 (i.e., no false positives or false negatives)

# Create arguments that represent confusion matrix components
# These should be numeric values (int or float)

tp = 50  # true positives
tn = 30  # true negatives
fp = 0   # false positives
fn = 0   # false negatives

ARGS = {
    "tp": tp,
    "tn": tn,
    "fp": fp,
    "fn": fn,
}
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 bool, 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
primal_value Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/models/model_based/smooth/smooth.py
code served (permissive licence) · get_code("2bd3ddbe941b22dd")
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 math

torch.manual_seed(0)

# Based on the function signature and body:
# - w: torch.tensor with shape (bs, m) where bs is batch size, m is number of features
# - x: torch.tensor with shape (bs, m) for element-wise multiplication
# - S: torch.tensor that performs matmul with w.unsqueeze(-1), so shape (n, m) where n is output dim
# - alpha: float, non-negative parameter
# - beta: float, non-negative parameter

batch_size = 2
m = 4  # dimension of w vectors
n = 3  # output dimension for S matrix

# w: (batch_size, m) tensor of non-negative values
w = torch.rand(batch_size, m)

# x: (batch_size, m) tensor for element-wise multiplication
x = torch.randn(batch_size, m)

# S: (n, m) matrix for matmul operation
# When S.matmul(w.unsqueeze(-1)) is called, w.unsqueeze(-1) has shape (batch_size, m, 1)
# and we need S to work with it, so S should be (n, m)
S = torch.randn(n, m)

# alpha and beta: non-negative floats
alpha = 0.5
beta = 0.3

ARGS = {
    'w': w,
    'x': x,
    'S': S,
    'alpha': alpha,
    'beta': beta
}
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
sample_spherical Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/misc/utils.py
code served (permissive licence) · get_code("d6f823e5f68c9d0a")
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 (3, 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
import torch

ARGS = {
    "npoints": 5,
    "ndim": 3,
    "rand_seed": 78,
}
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 ndarray, ndim 2, dtype family float, shape (3, 5) — shape (3, 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
smooth_objective Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/models/model_based/smooth/smooth.py
code served (permissive licence) · get_code("978f6f2b1520e6d2")
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
import math

torch.manual_seed(0)

# Analyze the function signature and body:
# - w: torch.tensor, shape (bs, m) where bs is batch size, m is half-vector dimension
# - x: torch.tensor, shape (bs, m) - element-wise multiplication with w
# - S: torch.tensor, used as S.matmul(w.unsqueeze(-1)), so S should be (N, m) where N is graph size
# - alpha: float, non-negative scaling parameter
# - beta: float, non-negative scaling parameter

# Create small tensors with distinct dimensions
bs = 2  # batch size
m = 4   # half-vector dimension (number of edges in half-vector form)
N = 3   # number of nodes (distinct from other dimensions)

# w: (batch_size, half_vector_dim)
w = torch.randn(bs, m).abs()  # Must be non-negative per constraint

# x: (batch_size, half_vector_dim) - used for element-wise multiplication
x = torch.randn(bs, m)

# S: (N, m) - used in S.matmul(w.unsqueeze(-1))
# w.unsqueeze(-1) gives shape (bs, m, 1)
# S.matmul() needs to broadcast/work with this
# S should be (N, m) to produce (N, bs) or similar after matmul
S = torch.randn(N, m)

# alpha, beta: non-negative floats
alpha = 0.5
beta = 0.3

ARGS = {
    'w': w,
    'x': x,
    'S': S,
    'alpha': alpha,
    'beta': beta
}
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
sumSquareForm Ran
ran on a synthesized input
maxwass/pyGSL/graph_learning/misc/utils.py
code served (permissive licence) · get_code("90dd80a487cccc41")
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 (5, 10) 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 torch

torch.manual_seed(0)

ARGS = {
    "N": 5,
    "dtype": np.int32,
    "out_dtype": torch.float32,
    "out_sparse": 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 Tensor, ndim 2, dtype family float, shape (5, 10) — shape (5, 10) 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
glasso_batch Not yet run
unverified (harvested, no recorded run)
maxwass/pyGSL/graph_learning/models/model_based/glasso/glasso.py
code served (permissive licence) · get_code("d91db99a58c3f085")
How it ran

no invocation recorded.

Also present in other papers' code

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

We introduce pyGSL, a Python library that provides efficient implementations of state-of-the-art graph structure learning models along with diverse datasets to evaluate them on. The implementations are written in GPU-friendly ways, allowing one to scale to much larger network tasks. A common interface is introduced for algorithm unrolling methods, unifying implementations of recent state-of-the-art techniques and allowing new methods to be quickly developed by avoiding the need to rebuild the underlying unrolling infrastructure. Implementations of differentiable graph structure learning models are written in PyTorch, allowing us to leverage the rich software ecosystem that exists e.g., around logging, hyperparameter search, and GPU-communication. This also makes it easy to incorporate these models as components in larger gradient based learning systems where differentiable estimates of graph structure may be useful, e.g. in latent graph learning. Diverse datasets and performance metrics allow consistent comparisons across models in this fast growing field. The full code repository can be found on https://github.com/maxwass/pyGSL. 36th Conference on Neural Information Processing Systems (NeurIPS 2022).

For agents

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

get_harvested_code_for_paper("2211.03583")
get_code_for_paper("2211.03583")
have("2211.03583")

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

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

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

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

Connect an agent — have() is free.