SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1803.04929 · 2018

Structural Agnostic Modeling: Adversarial Learning of Causal Graphs

arXiv · PDF · Open in the Atlas

Code that ran

5 of 9 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 4 have no contract verdict; 1 failure of our instrument; 4 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/1803.04929.json · badge: /api/ran/1803.04929.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
Diviyan-Kalainathan/SAM canonical (classifier label)
classifier basis: census
5 ran · 4 no recorded run
FunctionStatusWhere it lives
decompress_list Ran
ran on a synthesized input
Diviyan-Kalainathan/SAM/sam/utils/treillis.py
code served (permissive licence) · get_code("83a4439ffaf78634")
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 2, dtype family int; 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

def decompress_list(l):
    out = []
    for i in l:
        if type(i) == int:
            out = l
            break
        if type(i) == list:
            if type(i[0]) == list:
                for j in i:
                    out.append(j)
            else:
                out.append(i)
    return out

# Test case 1: list with nested lists containing lists
test_list = [
    [[1, 2], [3, 4]],
    [[5, 6], [7, 8]]
]

ARGS = {
    'l': test_list
}
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 2, dtype family int — 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
gumbel_sigmoid Ran
ran on a synthesized input
Diviyan-Kalainathan/SAM/sam/utils/gumble_utils.py
code served (permissive licence) · get_code("1189b0c4307ca015")
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 as th

th.manual_seed(0)

# Create small logits tensor (batch_size=2, features=4)
logits = th.randn(2, 4)

# Create ones_tensor and zeros_tensor with same shape as logits
ones_tensor = th.ones(2, 4)
zeros_tensor = th.zeros(2, 4)

# tau parameter
tau = 1.0

# hard parameter
hard = False

ARGS = {
    "logits": logits,
    "ones_tensor": ones_tensor,
    "zeros_tensor": zeros_tensor,
    "tau": tau,
    "hard": hard,
}
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
gumbel_softmax Ran
ran on a synthesized input
Diviyan-Kalainathan/SAM/sam/utils/gumble_utils.py
code served (permissive licence) · get_code("8db23fb76184682b")
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)

# Create a small batch of logits for gumbel_softmax
# Shape: [batch_size=2, n_class=4]
logits = torch.randn(2, 4)

ARGS = {
    "logits": logits,
    "tau": 1.0,
    "hard": False,
    "eps": 1e-10,
}
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
notears_constr Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Diviyan-Kalainathan/SAM/sam/utils/graph.py
code served (permissive licence) · get_code("51299d5807965bcd")
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 numpy as np

torch.manual_seed(0)

# adj_m should be a square matrix (adjacency matrix)
# The function performs matrix operations: @ (matmul), sum(), diag()
# It accesses .shape[1] to get the dimension
# It needs to support element-wise operations and summation

adj_m = torch.tensor([
    [0.0, 1.0, 0.5, 0.0],
    [0.0, 0.0, 1.0, 0.5],
    [0.0, 0.0, 0.0, 1.0],
    [1.0, 0.0, 0.0, 0.0]
], dtype=torch.float32)

max_pow = 4

ARGS = {
    "adj_m": adj_m,
    "max_pow": max_pow
}
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 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
treillis Ran
ran on a synthesized input
Diviyan-Kalainathan/SAM/sam/utils/treillis.py
code served (permissive licence) · get_code("576131778bd22221")
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. 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 numpy as np

# Create a small adjacency matrix for testing
# 5x5 matrix with some connections to enable path finding
adj_m = np.array([
    [0, 1, 1, 0, 0],
    [0, 0, 1, 1, 0],
    [0, 0, 0, 1, 1],
    [0, 0, 0, 0, 1],
    [0, 0, 0, 0, 0]
], dtype=int)

a = 0  # start node
b = 4  # end node
path = []  # initial empty path
maxlength = 5  # maximum path length

ARGS = {
    "adj_m": adj_m,
    "a": a,
    "b": b,
    "path": path,
    "maxlength": maxlength
}
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 — a list 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
compute_total_effect Not yet run
unverified (harvested, no recorded run)
Diviyan-Kalainathan/SAM/sam/utils/treillis.py
code served (permissive licence) · get_code("57a5622b077cb3f5")
How it ran

no invocation recorded.

functional_linear3d Not yet run
unverified (harvested, no recorded run)
Diviyan-Kalainathan/SAM/sam/utils/linear3d.py
code served (permissive licence) · get_code("6938344c3e48f119")
How it ran

no invocation recorded.

parallel_run Not yet run
unverified (harvested, no recorded run)
Diviyan-Kalainathan/SAM/sam/utils/parlib.py
code served (permissive licence) · get_code("61d0fe3ddc34ced1")
How it ran

no invocation recorded.

run_SAM Not yet run
unverified (harvested, no recorded run)
Diviyan-Kalainathan/SAM/sam/sam.py
code served (permissive licence) · get_code("bbb2e37df4189911")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 5 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
functional_linear3d 1 other paper
1 later
1903.02278 (2019-03)
Causal Discovery Toolbox: Uncover causal relationships in Python
gumbel_sigmoid 1 other paper
1 later
1903.02278 (2019-03)
Causal Discovery Toolbox: Uncover causal relationships in Python
gumbel_softmax 1 other paper
1 later
1903.02278 (2019-03)
Causal Discovery Toolbox: Uncover causal relationships in Python
notears_constr 1 other paper
1 later
1903.02278 (2019-03)
Causal Discovery Toolbox: Uncover causal relationships in Python

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

A new causal discovery method, Structural Agnostic Modeling (SAM), is presented in this paper. Leveraging both conditional independencies and distributional asymmetries, SAM aims to find the underlying causal structure from observational data. The approach is based on a game between different players estimating each variable distribution conditionally to the others as a neural net, and an adversary aimed at discriminating the generated data against the original data. A learning criterion combining distribution estimation, sparsity and acyclicity constraints is used to enforce the optimization of the graph structure and parameters through stochastic gradient descent. SAM is extensively experimentally validated on synthetic and real data.

For agents

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

get_harvested_code_for_paper("1803.04929")
get_code_for_paper("1803.04929")
have("1803.04929")

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

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

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

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

Connect an agent — have() is free.