SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.11987 · 2022

Predicting the impact of treatments over time with uncertainty aware neural differential equations

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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, 1 violated it and 8 have no contract verdict; 0 failures of our instrument; 1 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2202.11987.json · badge: /api/ran/2202.11987.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
microsoft/cf-ode canonical (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
FunctionStatusWhere it lives
sigmoid Ran
ran, violated the contract we drafted
microsoft/cf-ode/causalode/covid_data_utils.py
code served (permissive licence) · get_code("b8e95809ca2c17c9")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T02:39:00Z). 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

# The sigmoid function takes a single parameter 'x' which should be a numeric value or array
# Looking at the function body, it performs: 1 / (1 + np.exp(-x))
# This works with scalars, lists, or numpy arrays

# Create a small numpy array to pass as input
x_input = np.array([0.0, 1.0, -1.0, 2.0])

ARGS = {
    "x": x_input
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 1, dtype family float, shape (4,) — shape (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
create_pendulum_data Ran
ran on a synthesized input
microsoft/cf-ode/causalode/data_utils.py
code served (permissive licence) · get_code("a0f92181e281a453")
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 scipy.integrate import odeint

torch.manual_seed(0)
np.random.seed(0)

ARGS = {
    "N": 2,
    "gamma": 1.5,
    "noise_std": 0.1,
    "seed": 421,
    "continuous_treatment": False,
    "fixed_length": False,
    "static_x": False,
    "strong_confounding": False,
    "linspace_theta": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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
evaluate_preds Ran
ran on a synthesized input
microsoft/cf-ode/causalode/results_processing_utils.py
code served (permissive licence) · get_code("67612e37ae92132d")
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 torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    """Minimal model that returns means and stds of predictions"""
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(5, 8)  # input: X (5 dims) + T (1 dim) -> output: 8 dims (mu + var)
    
    def forward(self, X, T, return_decoded_u=False, times=None):
        # X shape: [batch, input_dim]
        # T shape: [batch]
        # times shape: [num_time_points]
        batch_size = X.shape[0]
        num_times = times.shape[0] if times is not None else 1
        
        # Output shape: [batch, num_times, 8] where 8 = 4 (mu) + 4 (var)
        output = torch.randn(batch_size, num_times, 8)
        
        decoded_u = torch.randn(batch_size, num_times, 4)  # dummy decoded_u
        
        if return_decoded_u:
            return output, decoded_u
        return output


class SimpleDataModule:
    """Minimal data module with test_dataloader"""
    def __init__(self):
        self.batch_size = 2
        self.input_dim = 5
        self.output_dim = 4
    
    def test_dataloader(self):
        # Returns list of batches
        # Each batch: (X, Y, T, Y_cf, p, thetas_0)
        batch_data = []
        
        for _ in range(2):  # 2 batches
            X = torch.randn(self.batch_size, self.input_dim)
            Y = torch.randn(self.batch_size, 10, self.output_dim)  # 10 time points
            T = torch.randint(0, 2, (self.batch_size,)).float()
            Y_cf = torch.randn(self.batch_size, 10, self.output_dim)
            p = torch.rand(self.batch_size)
            thetas_0 = torch.randn(self.batch_size, self.output_dim)
            
            batch_data.append((X, Y, T, Y_cf, p, thetas_0))
        
        return batch_data


model = SimpleModel()
dataset = SimpleDataModule()
t_lim = 5

ARGS = {
    "model": model,
    "dataset": dataset,
    "t_lim": t_lim,
}
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
fluids_input Ran
ran on a synthesized input
microsoft/cf-ode/causalode/covid_data_utils.py
code served (permissive licence) · get_code("254d0ba2bb6fc682")
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 1, dtype family float, shape (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

def fluids_input(t):
    return 5 * np.exp(-((t - 5) / 5) ** 2)

# The function takes a single parameter 't' which should be a numeric value or array
# It computes a Gaussian-like function centered at t=5
# We'll provide a small numpy array as input

t_value = np.array([0.0, 5.0, 10.0, 15.0])

ARGS = {
    "t": t_value
}
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 1, dtype family float, shape (4,) — shape (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
get_processed_data Ran
ran on a synthesized input
microsoft/cf-ode/causalode/utils.py
code served (permissive licence) · get_code("2eae4defcee2ef7a")
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 numpy as np
import pandas as pd

# Create minimal raw_sim_data dictionary with required keys
num_patients = 2
num_timesteps = 3

raw_sim_data = {
    'cancer_volume': np.random.randn(num_patients, num_timesteps),
    'cancer_volume_cf': np.random.randn(num_patients, num_timesteps),
    'patient_types': np.random.randn(num_patients, num_timesteps),
    'chemo_application': np.random.randint(0, 2, (num_patients, num_timesteps)),
    'radio_application': np.random.randint(0, 2, (num_patients, num_timesteps)),
    'sequence_lengths': np.array([num_timesteps, num_timesteps]),
}

# Create scaling_params as tuple of two pandas Series with required columns
mean = pd.Series({
    'cancer_volume': 50.0,
    'patient_types': 0.5,
    'chemo_application': 0.0,
    'radio_application': 0.0,
})

std = pd.Series({
    'cancer_volume': 10.0,
    'patient_types': 0.2,
    'chemo_application': 1.0,
    'radio_application': 1.0,
})

scaling_params = (mean, std)

ARGS = {
    'raw_sim_data': raw_sim_data,
    'scaling_params': scaling_params,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
plot_aggregated Ran
ran on a synthesized input
microsoft/cf-ode/causalode/results_processing_utils.py
code served (permissive licence) · get_code("6bd430029659230e")
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 Figure. 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
import matplotlib.pyplot as plt

# Create sample curve data
# The function expects curve_dict with keys like 'random', 'propensity', 'uncertainty'
# Each value should be a list/array of curves that can be stacked
np.random.seed(0)

# Create 3 sets of curves (simulating multiple runs)
# Each curve has 100 points (since x-axis goes from 0 to 100)
random_curves = [np.random.uniform(0.2, 1.4, 100) for _ in range(3)]
propensity_curves = [np.random.uniform(0.2, 1.3, 100) for _ in range(3)]
uncertainty_curves = [np.random.uniform(0.3, 1.2, 100) for _ in range(3)]

curve_dict = {
    'random': random_curves,
    'propensity': propensity_curves,
    'uncertainty': uncertainty_curves
}

ARGS = {
    'curve_dict': curve_dict,
    'start_idx': 5,
    'rec_type': 'Test',
    'path': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure 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
str2bool Ran
ran on a synthesized input
microsoft/cf-ode/causalode/utils.py
code served (permissive licence) · get_code("ea460228c91f41f4")
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 sys

ARGS = {
    'value': 'true',
    'raise_exc': 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 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
update_dict Ran
ran on a synthesized input
microsoft/cf-ode/causalode/results_processing_utils.py
code served (permissive licence) · get_code("027ecb7d833a1bf2")
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)

# Construct valid arguments for update_dict
# The function expects:
# - main_dict: a dict where values are lists that can have items appended to them
# - new_dict: a dict with keys that match main_dict keys and values to append

main_dict = {
    'loss': [],
    'accuracy': [],
    'metric': []
}

new_dict = {
    'loss': 0.5,
    'accuracy': 0.95,
    'metric': 42
}

ARGS = {
    'main_dict': main_dict,
    'new_dict': new_dict
}
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
v_fun Ran
ran on a synthesized input
microsoft/cf-ode/causalode/covid_data_utils.py
code served (permissive licence) · get_code("e18ed2b8a0270bb8")
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 1, dtype family float, shape (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

def v_fun(x):
    return 0.02 * (np.cos(5 * x - 0.2) * (5 - x) ** 2) ** 2

# Create a small numpy array as input
x = np.linspace(0, 5, 10)

ARGS = {
    'x': x
}
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 1, dtype family float, shape (10,) — shape (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
get_mse_at_follow_up_time Not yet run
unverified (harvested, no recorded run)
microsoft/cf-ode/causalode/utils.py
code served (permissive licence) · get_code("f8b7195b5d9d50be")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 8 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
sigmoid 51 other papers
20 dated earlier, 30 later, 1 same year, order not determinable · 2 only as an assembly brick
1505.05770 (2015-05)
Variational Inference with Normalizing Flows
1804.00779 (2018-04)
Neural Autoregressive Flows
1809.10765 (2018-09)
Auto-Encoding Knockoff Generator for FDR Controlled Variable Selection
and 48 more not named here
get_mse_at_follow_up_time 1 other paper
1 dated earlier
2002.04083 (2020-02)
Estimating Counterfactual Treatment Outcomes over Time Through Adversarially Balanced Representations

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

Predicting the impact of treatments from observational data only still represents a majorchallenge despite recent significant advances in time series modeling. Treatment assignments are usually correlated with the predictors of the response, resulting in a lack of data support for counterfactual predictions and therefore in poor quality estimates. Developments in causal inference have lead to methods addressing this confounding by requiring a minimum level of overlap. However,overlap is difficult to assess and usually notsatisfied in practice. In this work, we propose Counterfactual ODE (CF-ODE), a novel method to predict the impact of treatments continuously over time using Neural Ordinary Differential Equations equipped with uncertainty estimates. This allows to specifically assess which treatment outcomes can be reliably predicted. We demonstrate over several longitudinal data sets that CF-ODE provides more accurate predictions and more reliable uncertainty estimates than previously available methods.

For agents

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

get_harvested_code_for_paper("2202.11987")
get_code_for_paper("2202.11987")
have("2202.11987")

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

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

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

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

Connect an agent — have() is free.