SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.06485 · NeurIPS · 2020

Deep Structural Causal Models for Tractable Counterfactual Inference

Nick Pawlowski, Daniel Castro, Ben Glocker

arXiv · PDF · Open in the Atlas

Code that ran

12 of 20 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (8 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 3 failures of our instrument; 8 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/2006.06485.json · badge: /api/ran/2006.06485.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
biomedia-mira/deepscm canonical (classifier label)
classifier basis: classifier_2025
5 ran · 5 no recorded run
biomedia-mira/causal-gen community
Papers with Code archive
4 ran · 3 no recorded run
rongguangw/flow-scm community
Papers with Code archive
3 ran · 0 no recorded run
FunctionStatusWhere it lives
ActNorm Ran
ran on a synthesized input · constructed an object; no result was computed
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("f68de70f80950eeb")
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 an instance of its own class, ActNorm: the run constructed the object and did not call it, so no result was computed. 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
from torch.distributions import constraints
from pyro.distributions.torch_transform import TransformModule

torch.manual_seed(0)

class ActNorm(TransformModule):
    codomain = constraints.real
    bijective = True
    event_dim = 3

    def __init__(self, features):
        """
        Transform that performs activation normalization. Works for 2D and 4D inputs. For 4D
        inputs (images) normalization is performed per-channel, assuming BxCxHxW input shape.

        Reference:
        > D. Kingma et. al., Glow: Generative flow with invertible 1x1 convolutions, NeurIPS 2018.
        """
        super().__init__()
        self.initialized = False
        self.log_scale = nn.Parameter(torch.zeros(features))
        self.shift = nn.Parameter(torch.zeros(features))

    @property
    def scale(self):
        return torch.exp(self.log_scale)

    def _broadcastable_scale_shift(self, inputs):
        if inputs.dim() == 4:
            return (self.scale.view(1, -1, 1, 1), self.shift.view(1, -1, 1, 1))
        else:
            return (self.scale.view(1, -1), self.shift.view(1, -1))

    def _call(self, x):
        if x.dim() not in [2, 4]:
            raise ValueError('Expecting inputs to be a 2D or a 4D tensor.')
        if self.training and (not self.initialized):
            self._initialize(x)
        scale, shift = self._broadcastable_scale_shift(x)
        outputs = scale * x + shift
        return outputs

    def _inverse(self, y):
        if y.dim() not in [2, 4]:
            raise ValueError('Expecting inputs to be a 2D or a 4D tensor.')
        scale, shift = self._broadcastable_scale_shift(y)
        outputs = (y - shift) / scale
        return outputs

    def log_abs_det_jacobian(self, x, y):
        """
        Calculates the elementwise determinant of the log Jacobian, i.e.
        log(abs([dy_0/dx_0, ..., dy_{N-1}/dx_{N-1}])). Note that this type of
        transform is not autoregressive, so the log Jacobian is not the sum of the
        previous expression. However, it turns out it's always 0 (since the
        determinant is -1 or +1), and so returning a vector of zeros works.
        """
        ones = torch.ones(x.shape[0], device=x.device)
        if x.dim() == 4:
            _, _, h, w = x.shape
            log_abs_det_jacobian = h * w * torch.sum(self.log_scale) * ones
        else:
            log_abs_det_jacobian = torch.sum(self.log_scale) * ones
        return log_abs_det_jacobian

    def _initialize(self, inputs):
        """Data-dependent initialization, s.t. post-actnorm activations have zero mean and unit
        variance. """
        if inputs.dim() == 4:
            num_channels = inputs.shape[1]
            inputs = inputs.permute(0, 2, 3, 1).reshape(-1, num_channels)
        with torch.no_grad():
            std = inputs.std(dim=0)
            mu = (inputs / std).mean(dim=0)
            self.log_scale.data = -torch.log(std)
            self.shift.data = -mu
        self.initialized = True


ARGS = {
    "features": 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pyro, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ActNorm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ActNorm 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
BaseSEM Ran
ran on a synthesized input · constructed an object; no result was computed
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("e8590010c32109d2")
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 an instance of its own class, BaseSEM: the run constructed the object and did not call it, so no result was computed. 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
from pyro.distributions import Normal, TransformedDistribution
from pyro.distributions.transforms import AffineTransform, ComposeTransform, SigmoidTransform

torch.manual_seed(0)

ARGS = {
    'preprocessing': 'realnvp'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pyro, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BaseSEM — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BaseSEM 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
BasicFlowConvNet Ran
ran on a synthesized input · constructed an object; no result was computed
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("94342d5b16f1ca84")
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 an instance of its own class, BasicFlowConvNet: the run constructed the object and did not call it, so no result was computed. 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 torch import nn

torch.manual_seed(0)

# Define ARGS for BasicFlowConvNet
ARGS = {
    'in_channels': 3,
    'hidden_channels': 8,
    'param_dims': [2, 3],
    'context_dims': 4,
    'param_nonlinearities': [torch.sigmoid, torch.tanh]
}
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 BasicFlowConvNet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BasicFlowConvNet 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
ConditionalAffineTransform Ran
ran on a synthesized input · constructed an object; no result was computed
rongguangw/flow-scm/models/nfs.py
pointer only (licence: NOASSERTION) · get_code("2e4cf3c6eda70520")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, rongguangw/flow-scm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

ConditionalAffineTransform Ran
ran on a synthesized input · constructed an object; no result was computed
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("a8205893b4e93a15")
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 an instance of its own class, ConditionalAffineTransform: the run constructed the object and did not call it, so no result was computed. 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
from pyro.distributions.conditional import ConditionalTransformModule
from torch.distributions import transforms

torch.manual_seed(0)

class ContextNN(nn.Module):
    """Minimal context network that outputs loc and log_scale"""
    def __init__(self, context_dim=3, output_dim=4):
        super().__init__()
        self.fc = nn.Linear(context_dim, output_dim * 2)
        self.output_dim = output_dim
    
    def forward(self, context):
        batch_size = context.shape[0]
        out = self.fc(context)
        loc = out[:, :self.output_dim]
        log_scale = out[:, self.output_dim:]
        return loc, log_scale

context_nn = ContextNN(context_dim=3, output_dim=4)

ARGS = {
    "context_nn": context_nn,
    "event_dim": 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pyro, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ConditionalAffineTransform — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ConditionalAffineTransform 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
ConditionalSCM Ran
ran on a synthesized input · constructed an object; no result was computed
rongguangw/flow-scm/models/nfs.py
pointer only (licence: NOASSERTION) · get_code("c1848ecedee520df")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, rongguangw/flow-scm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

DSCM Ran
ran on a synthesized input · constructed an object; no result was computed
biomedia-mira/causal-gen/src/pgm/dscm.py
code served (permissive licence) · get_code("bf6be067c32aa776")
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 an instance of its own class, DSCM: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import pyro
from pyro.infer import Trace_ELBO

torch.manual_seed(0)

class DummyPGM(nn.Module):
    def __init__(self):
        super().__init__()
        self.dummy_param = nn.Parameter(torch.zeros(1))
    
    def counterfactual(self, obs, intervention, num_particles=1):
        # Return counterfactual parents with same structure as obs
        cf_pa = {}
        for k, v in obs.items():
            cf_pa[k] = v.clone() + 0.1
        return cf_pa

class DummyPredictor(nn.Module):
    def __init__(self):
        super().__init__()
        self.dummy_param = nn.Parameter(torch.zeros(1))
    
    def model_anticausal(self, **kwargs):
        pass
    
    def guide_pass(self, **kwargs):
        pass

class DummyVAE(nn.Module):
    def __init__(self):
        super().__init__()
        self.encoder = nn.Linear(4, 8)
        self.decoder = nn.Linear(8, 4)
    
    def forward(self, x, parents, beta=1.0):
        # Return dict with 'elbo' key
        z = self.encoder(x)
        recon = self.decoder(z)
        elbo = torch.tensor(-1.0)
        return {'elbo': elbo, 'recon_loss': torch.tensor(0.5)}
    
    def abduct(self, x, parents, t=1.0):
        # Return latent codes
        return self.encoder(x)
    
    def forward_latents(self, zs, parents):
        # Return loc and scale
        batch_size = zs.shape[0]
        loc = torch.randn(batch_size, 4)
        scale = torch.ones(batch_size, 4) * 0.5
        return loc, scale

class DummyHparams:
    def __init__(self):
        self.dataset = 'ukbb'
        self.parents_x = ['age', 'brain_volume', 'ventricle_volume']
        self.input_res = 2
        self.lmbda_init = 0.5
        self.elbo_constraint = 1.0
        self.beta = 1.0
        self.damping = 0.1
    
    def update(self, dict):
        for k, v in dict.items():
            setattr(self, k, v)

pgm = DummyPGM()
predictor = DummyPredictor()
vae = DummyVAE()
args = DummyHparams()

# Create observation dict with required keys
obs = {
    'x': torch.randn(2, 4),
    'age': torch.randn(2, 1),
    'brain_volume': torch.randn(2, 1),
    'ventricle_volume': torch.randn(2, 1),
}

# Create intervention dict
do = {
    'age': torch.randn(2, 1),
}

# Create ELBO function
elbo_fn = Trace_ELBO()

ARGS = {
    'args': args,
    'pgm': pgm,
    'predictor': predictor,
    'vae': vae,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pyro, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DSCM — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DSCM 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
SqueezeTransform Ran
ran on a synthesized input · constructed an object; no result was computed
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("50e3c28ae2e23efd")
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 an instance of its own class, SqueezeTransform: the run constructed the object and did not call it, so no result was computed. 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 torch.distributions.transforms import Transform

torch.manual_seed(0)

ARGS = {
    "factor": 2
}
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 SqueezeTransform — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SqueezeTransform 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
conditional_spline_autoregressive Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
rongguangw/flow-scm/models/nfs.py
pointer only (licence: NOASSERTION) · get_code("9a75d6db9c391bc1")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, rongguangw/flow-scm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_attr_max_min Ran
ran, honoured the contract we drafted
biomedia-mira/causal-gen/src/pgm/dscm.py
code served (permissive licence) · get_code("a4d7c4fb6e70eb53")
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, ndim 1, 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

torch.manual_seed(0)

ARGS = {
    'attr': 'age'
}
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, ndim 1, dtype family int — a tuple 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
ukbb_preprocess Ran
ran; our contract draft was wrong, not the code
biomedia-mira/causal-gen/src/pgm/dscm.py
code served (permissive licence) · get_code("0db6a51b39341f69")
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 torch

torch.manual_seed(0)

# Create a dictionary with tensors for each attribute
# The function expects keys: 'age', 'brain_volume', 'ventricle_volume', 'mri_seq', 'sex'
pa = {
    'age': torch.tensor([[50.0, 55.0, 60.0, 65.0],
                         [45.0, 48.0, 52.0, 58.0]]),
    'brain_volume': torch.tensor([[1200000.0, 1300000.0, 1400000.0, 1500000.0],
                                  [900000.0, 950000.0, 1000000.0, 1100000.0]]),
    'ventricle_volume': torch.tensor([[50000.0, 60000.0, 70000.0, 80000.0],
                                      [20000.0, 30000.0, 40000.0, 50000.0]]),
    'mri_seq': torch.tensor([[1.0, 2.0, 3.0, 4.0],
                             [2.0, 3.0, 4.0, 5.0]]),
    'sex': torch.tensor([[0.0, 1.0, 0.0, 1.0],
                         [1.0, 0.0, 1.0, 0.0]])
}

ARGS = {
    'pa': pa
}
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 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
vae_preprocess Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
biomedia-mira/causal-gen/src/pgm/dscm.py
code served (permissive licence) · get_code("7f3c7862828e87cf")
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 4, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch import Tensor
import torch.nn as nn

torch.manual_seed(0)

class Hparams:
    def update(self, dict):
        for k, v in dict.items():
            setattr(self, k, v)

# Create args with required attributes
args = Hparams()
args.dataset = 'ukbb_test'
args.parents_x = ['age', 'brain_volume', 'ventricle_volume']
args.input_res = 4

# Create parent attributes dict with proper tensor shapes
pa = {
    'age': torch.tensor([[4.5], [4.3]]),  # shape (2, 1)
    'brain_volume': torch.tensor([[13.5], [13.4]]),  # shape (2, 1)
    'ventricle_volume': torch.tensor([[10.2], [10.1]]),  # shape (2, 1)
    'sex': torch.tensor([[0], [1]]),  # shape (2, 1) - should be skipped
    'mri_seq': torch.tensor([[1], [2]])  # shape (2, 1) - should be skipped
}

ARGS = {
    'args': args,
    'pa': pa
}
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 4, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
BaseFlowSEM Not yet run
unverified (harvested, no recorded run)
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("201e09ee2d9716ee")
How it ran

no invocation recorded.

ConditionalFlowSEM Not yet run
unverified (harvested, no recorded run)
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("536c07328829a20b")
How it ran

no invocation recorded.

Hparams Not yet run
unverified (harvested, no recorded run)
biomedia-mira/causal-gen/src/pgm/dscm.py
code served (permissive licence) · get_code("2a36741ebd1f5acd")
How it ran

no invocation recorded.

ReshapeTransform Not yet run
unverified (harvested, no recorded run)
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("7eb735aaea9726cd")
How it ran

no invocation recorded.

TraceStorage_ELBO Not yet run
unverified (harvested, no recorded run)
biomedia-mira/causal-gen/src/pgm/dscm.py
code served (permissive licence) · get_code("e9dec58a402e8b3f")
How it ran

no invocation recorded.

TransposeTransform Not yet run
unverified (harvested, no recorded run)
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("546c4140e5db7144")
How it ran

no invocation recorded.

check_nan Not yet run
unverified (harvested, no recorded run)
biomedia-mira/causal-gen/src/pgm/dscm.py
code served (permissive licence) · get_code("72901075b1db0ad0")
How it ran

no invocation recorded.

weights_init Not yet run
unverified (harvested, no recorded run)
biomedia-mira/deepscm/deepscm/experiments/morphomnist/nf/conditional_flow_sem.py
code served (permissive licence) · get_code("82b9f1b46a36f4f4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 20 samples lifted from this paper's linked repositories, 20 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 18 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
get_attr_max_min
brick of this paper's assembly: helper
1 other paper
1 later
2402.01607 (2024-02)
Natural Counterfactuals With Necessary Backtracking

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 formulate a general framework for building structural causal models (SCMs) with deep learning components. The proposed approach employs normalising flows and variational inference to enable tractable inference of exogenous noise variables-a crucial step for counterfactual inference that is missing from existing deep causal learning methods. Our framework is validated on a synthetic dataset built on MNIST as well as on a real-world medical dataset of brain MRI scans. Our experimental results indicate that we can successfully train deep SCMs that are capable of all three levels of Pearl's ladder of causation: association, intervention, and counterfactuals, giving rise to a powerful new approach for answering causal questions in imaging applications and beyond. The code for all our experiments is available at https://github.com/biomedia-mira/deepscm.

For agents

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

get_harvested_code_for_paper("2006.06485")
get_code_for_paper("2006.06485")
have("2006.06485")

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

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

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

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

Connect an agent — have() is free.