SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.13348 · 2023

Kernel Conditional Moment Constraints for Confounding Robust Inference

arXiv · PDF · Open in the Atlas

Code that ran

15 of 17 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 15 have no contract verdict; 0 failures of our instrument; 2 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/2302.13348.json · badge: /api/ran/2302.13348.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
kstoneriv3/confounding-robust-inference-old canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
kstoneriv3/confounding-robust-inference community (classifier label)
classifier basis not recorded on the link
8 ran · 0 no recorded run
FunctionStatusWhere it lives
apply_black_magic Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference/confounding_robust_inference/estimators/kcmc.py
code served (permissive licence) · get_code("7796c220a2ef55ef")
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 (2, 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

# Construct arguments for apply_black_magic
# Psi: (batch_size, num_features) array
# p_t: (batch_size,) array
# pi: optional (batch_size,) array

batch_size = 2
num_features = 4

# Create Psi as a 2D array (batch_size x num_features)
Psi = np.random.randn(batch_size, num_features).astype(np.float32)

# Create p_t as a 1D array (batch_size,)
p_t = np.array([0.5, 2.0], dtype=np.float32)

# Create pi as a 1D array (batch_size,) - optional parameter
pi = np.array([1.5, 0.8], dtype=np.float32)

ARGS = {
    "Psi": Psi,
    "p_t": p_t,
    "pi": pi
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 5) — shape (2, 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
as_tensor Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference/confounding_robust_inference/utils/types.py
code served (permissive licence) · get_code("d9d53255711b0de6")
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)

# Test with a float
arg1 = 3.14

# Test with a list
arg2 = [1.0, 2.0, 3.0, 4.0]

# Test with a numpy array
arg3 = np.array([5.0, 6.0, 7.0, 8.0])

ARGS = {
    "arr": arg1
}
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
estimate_p_t Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference-old/kcmc/data_continuous.py
code served (permissive licence) · get_code("c2b0de5d429130d0")
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
import warnings

# Set random seed for reproducibility
np.random.seed(0)

# Create small sample data
# X should be a 2D array of features (n_samples, n_features)
# T should be a 1D array of target values in (0, 1) range for BetaModel
n_samples = 10
n_features = 5

X = np.random.rand(n_samples, n_features).astype(np.float64)

# T needs to be in (0, 1) for BetaModel (beta regression)
# Using values strictly between 0 and 1
T = np.random.uniform(0.1, 0.9, n_samples).astype(np.float64)

ARGS = {
    "X": X,
    "T": T,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, statsmodels — 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
evaluate_policy Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference-old/kcmc/data_binary.py
code served (permissive licence) · get_code("212507fb5a1cb43c")
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 numpy as np
import torch
import torch.nn as nn

torch.manual_seed(0)

class SimplePolicy(nn.Module):
    def __init__(self, input_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, 1)
    
    def forward(self, X, context):
        # X is numpy array, convert to tensor
        X_tensor = torch.as_tensor(X, dtype=torch.float32)
        output = self.linear(X_tensor)
        return torch.sigmoid(output).squeeze(-1)

policy = SimplePolicy(input_dim=5)

ARGS = {
    "policy": policy,
    "n": 10
}
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
evaluate_policy Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference-old/kcmc/data_continuous.py
code served (permissive licence) · get_code("92802e330a871651")
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 numpy as np
import torch
import torch.nn as nn

torch.manual_seed(0)

class DummyPolicy(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(5, 1)
    
    def forward(self, X, return_sample=False, requires_grad=False):
        # X is shape (n, 5)
        # Should return binary treatment T of shape (n,)
        X_tensor = torch.as_tensor(X, dtype=torch.float32)
        if requires_grad:
            X_tensor = X_tensor.requires_grad_(True)
        logits = self.linear(X_tensor).squeeze(-1)
        probs = torch.sigmoid(logits)
        if return_sample:
            T = (torch.rand_like(probs) < probs).float()
        else:
            T = probs
        return T

policy = DummyPolicy()

ARGS = {
    "policy": policy,
    "n": 1000,
    "requires_grad": 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 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
find_method_names Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference/confounding_robust_inference/utils/docs.py
code served (permissive licence) · get_code("85c21527f1667191")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import types
from typing import Any, Callable, Dict, Protocol, Sequence


class SimpleClass:
    def method_one(self):
        pass
    
    def method_two(self):
        pass


class ParentClass:
    def parent_method(self):
        pass


class ChildClass(ParentClass):
    def method_one(self):
        pass
    
    def method_two(self):
        pass


ARGS = {
    "cls": ChildClass
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_methods Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference/confounding_robust_inference/utils/docs.py
code served (permissive licence) · get_code("6bf9c395e73ff0c4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import types
from typing import Any, Callable

# Create a simple parent class
class ParentClass:
    def parent_method(self):
        pass

# Create a child class that inherits from ParentClass
class ChildClass(ParentClass):
    def child_method(self):
        pass
    
    def another_child_method(self):
        pass

# The function finds methods defined in ChildClass but not in its parents
# It takes a class as input and returns a list of callables (methods)

ARGS = {
    "cls": ChildClass
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_parent_classes_with_method_docstring Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference/confounding_robust_inference/utils/docs.py
code served (permissive licence) · get_code("efa0b6a8184124f0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Build test classes with methods and docstrings
class GrandparentA:
    def test_method(self):
        """Grandparent A docstring"""
        pass

class GrandparentB:
    def test_method(self):
        """Grandparent B docstring"""
        pass

class ParentWithDocstring(GrandparentA):
    def test_method(self):
        """Parent docstring"""
        pass

class ParentWithoutDocstring(GrandparentB):
    def test_method(self):
        pass

class ChildClass(ParentWithDocstring, ParentWithoutDocstring):
    pass

ARGS = {
    "cls": ChildClass,
    "method_name": "test_method"
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
generate_data Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference-old/kcmc/data_binary.py
code served (permissive licence) · get_code("7183e20cd75cfd98")
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 numpy as np
import torch

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

ARGS = {
    "n": 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 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
generate_data Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference-old/kcmc/data_continuous.py
code served (permissive licence) · get_code("c7f42d4663c6fe4d")
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 numpy as np
from scipy.stats import beta
import torch

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

ARGS = {
    "n": 2
}
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
get_hajek_constraints Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference/confounding_robust_inference/estimators/constraints.py
code served (permissive licence) · get_code("27ab0086abac400d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import cvxpy as cp
import numpy as np

# Set up small example data
n_samples = 5
n_features = 3

# Create T array: treatment assignments (should be small integers)
T = np.array([0, 0, 1, 1, 2])

# Create p_t array: propensity scores (probabilities for each sample)
p_t = np.array([0.4, 0.4, 0.3, 0.3, 0.5])

# Create w variable: weights to be optimized
w = cp.Variable(n_samples)

# Set use_fractional_programming flag
use_fractional_programming = True

ARGS = {
    "w": w,
    "T": T,
    "p_t": p_t,
    "use_fractional_programming": use_fractional_programming
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_multipliers Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference/confounding_robust_inference/estimators/ncmc.py
code served (permissive licence) · get_code("acada98a30d3ca55")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "input_dim": 4,
    "n_hidden": 8,
    "n_layers": 3,
    "seed": 0,
}
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
get_normal_ci Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference/confounding_robust_inference/estimators/misc.py
code served (permissive licence) · get_code("1bccadf4ce63ff7b")
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 float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a 1D tensor of samples (the function asserts len(samples.shape) == 1)
samples = torch.randn(10)

# Alpha is a float representing the significance level
alpha = 0.05

ARGS = {
    "samples": samples,
    "alpha": alpha,
}
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 float — 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
hajek Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference-old/kcmc/estimators.py
code served (permissive licence) · get_code("0fb486d9a4b3bf40")
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 numpy as np
import torch

torch.manual_seed(0)

# Y: outcome variable, should be a tensor
Y = torch.tensor([1.0, 2.0], dtype=torch.float32)

# T: treatment assignment, should be an array with treatment group indicators
T = np.array([0, 1])

# X: features/covariates, should be a tensor or array
X = torch.tensor([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]], dtype=torch.float32)

# p_t: propensity scores, should be an array with shape (n,)
p_t = np.array([0.5, 0.5])

# policy: a callable that takes (X, T) and returns a tensor
def policy(X, T):
    # Returns a tensor of shape (n,) with policy values
    return torch.ones(X.shape[0], dtype=torch.float32)

ARGS = {
    "Y": Y,
    "T": T,
    "X": X,
    "p_t": p_t,
    "policy": policy,
    "return_w": 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 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
ipw Ran
ran on a synthesized input
kstoneriv3/confounding-robust-inference-old/kcmc/estimators.py
code served (permissive licence) · get_code("b1404ab21db97d52")
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 torch.nn as nn

torch.manual_seed(0)

# Y: outcome tensor, shape (n,)
Y = torch.tensor([1.0, 2.0])

# T: treatment tensor, shape (n,)
T = torch.tensor([0, 1])

# X: feature tensor, shape (n, d)
X = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

# p_t: propensity scores, shape (n,)
p_t = torch.tensor([0.3, 0.7])

# policy: a callable that takes (X, T) and returns reward/weight tensor
class SimplePolicy(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
    
    def forward(self, X, T):
        # Takes X (n, 4) and T (n,), returns (n,) tensor
        out = self.linear(X).squeeze(-1)
        return out

policy = SimplePolicy()

ARGS = {
    "Y": Y,
    "T": T,
    "X": X,
    "p_t": p_t,
    "policy": policy
}
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 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
estimate_p_t Not yet run
unverified (harvested, no recorded run)
kstoneriv3/confounding-robust-inference-old/kcmc/data_binary.py
code served (permissive licence) · get_code("d668cc89fa16f23f")
How it ran

no invocation recorded.

get_data Not yet run
unverified (harvested, no recorded run)
kstoneriv3/confounding-robust-inference-old/kcmc/experiment_policy_evaluation.py
code served (permissive licence) · get_code("14d72f0a39adc134")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 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 17 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 study policy evaluation of offline contextual bandits subject to unobserved confounders. Sensitivity analysis methods are commonly used to estimate the policy value under the worst-case confounding over a given uncertainty set. However, existing work often resorts to some coarse relaxation of the uncertainty set for the sake of tractability, leading to overly conservative estimation of the policy value. In this paper, we propose a general estimator that provides a sharp lower bound of the policy value. It can be shown that our estimator contains the recently proposed sharp estimator by Dorn and Guo (2022) as a special case, and our method enables a novel extension of the classical marginal sensitivity model using f-divergence. To construct our estimator, we leverage the kernel method to obtain a tractable approximation to the conditional moment constraints, which traditional non-sharp estimators failed to take into account. In the theoretical analysis, we provide a condition for the choice of the kernel which guarantees no specification error that biases the lower bound estimation. Furthermore, we provide consistency guarantees of policy evaluation and learning. In the experiments with synthetic and real-world data, we demonstrate the effectiveness of the proposed method.

For agents

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

get_harvested_code_for_paper("2302.13348")
get_code_for_paper("2302.13348")
have("2302.13348")

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

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

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

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

Connect an agent — have() is free.