SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.12819 · ICLR · 2024

Doubly Robust Proximal Causal Learning for Continuous Treatments

Xinwei Sun, Yong Wu, Yanwei Fu, Shouyan Wang

arXiv · PDF · Open in the Atlas

Code that ran

2 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 0 failures 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/2309.12819.json · badge: /api/ran/2309.12819.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
yezichu/pcl_continuous_treatment canonical (classifier label)
classifier basis: classifier_2025
2 ran · 4 no recorded run
FunctionStatusWhere it lives
_BaseRKHSIV Ran
ran on a synthesized input · constructed an object; no result was computed
yezichu/pcl_continuous_treatment/model/rkhs/rkhs_approx.py
code served (permissive licence) · get_code("caf0a8ede43b2ebe")
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, _BaseRKHSIV: 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 numpy as np
from sklearn.metrics.pairwise import pairwise_kernels

def custom_kernel(X, Y=None, **kwargs):
    """Simple custom kernel function for testing."""
    if Y is None:
        Y = X
    return np.dot(X, Y.T)

class _BaseRKHSIV:

    def __init__(self, *args, **kwargs):
        """
        Base class for RKHS-IV (Reproducing Kernel Hilbert Space - Instrumental Variables).

        Args:
            *args: Variable length argument list.
            **kwargs: Arbitrary keyword arguments.
        """
        pass

    def _get_delta(self, n: int) -> float:
        """
        Compute the critical radius delta.

        Args:
            n (int): The number of samples.

        Returns:
            float: The computed delta value -> Critical radius.
        """
        delta_scale = 5 if isinstance(self.delta_scale, str) and self.delta_scale == 'auto' else self.delta_scale
        delta_exp = 0.4 if isinstance(self.delta_exp, str) and self.delta_exp == 'auto' else self.delta_exp
        return delta_scale / n ** delta_exp

    def _get_alpha_scale(self):
        """
        Get the alpha scale parameter.

        Returns:
            float: The alpha scale parameter.
        """
        return 60 if isinstance(self.alpha_scale, str) and self.alpha_scale == 'auto' else self.alpha_scale

    def _get_alpha_scales(self):
        """
        Get a list of alpha scales.

        Returns:
            list: A list of alpha scales.
        """
        return [c for c in np.geomspace(0.1, 100000.0, self.n_alphas)] if isinstance(self.alpha_scales, str) and self.alpha_scales == 'auto' else self.alpha_scales

    def _get_alpha(self, delta, alpha_scale):
        """
        Compute the alpha parameter.

        Args:
            delta (float): The delta value.
            alpha_scale (float): The alpha scale.

        Returns:
            float: The computed alpha value.
        """
        return alpha_scale * delta ** 4

    def _get_kernel(self, X, Y=None):
        """
        Compute the kernel matrix using the specified kernel function.

        Args:
            X (array-like): The data matrix.
            Y (array-like, optional): The second data matrix.

        Returns:
            array: The computed kernel matrix.
        """
        if callable(self.kernel):
            params = self.kernel_params or {}
        else:
            params = {'gamma': self.gamma, 'degree': self.degree, 'coef0': self.coef0}
        return pairwise_kernels(X, Y, metric=self.kernel, filter_params=True, **params)

    def _get_gamma_gm(self, condition):
        """
        Compute the gamma parameter for Gaussian kernel (GM) based on median heuristic.

        Args:
            condition (array-like): The conditioning variables.

        Returns:
            float: The computed gamma parameter.
        """
        if isinstance(self.gamma_gm, str) and self.gamma_gm == 'auto':
            params = {'squared': True}
            from sklearn.metrics.pairwise import pairwise_distances
            K_condition_euclidean = pairwise_distances(X=condition, metric='euclidean', n_jobs=-1, **params)
            gamma_gm = 1.0 / np.median(K_condition_euclidean[np.tril_indices(condition.shape[0], -1)])
            return gamma_gm
        else:
            return self.gamma_gm

    def _get_kernel_gm(self, X, Y=None, gamma_gm=0.1):
        """
        Compute the Gaussian kernel matrix with specified gamma for Gaussian mechanism.

        Args:
            X (array-like): The data matrix.
            Y (array-like, optional): The second data matrix.
            gamma_gm (float, optional): The gamma parameter for Gaussian kernel.

        Returns:
            array: The computed kernel matrix.
        """
        params = {'gamma': gamma_gm}
        return pairwise_kernels(X, Y, metric='rbf', filter_params=True, **params)

    def _get_kernel_hq(self, X, Y=None, gamma_h=0.01):
        """
        Compute the kernel matrix for high-quality kernel with specified gamma.

        Args:
            X (array-like): The data matrix.
            Y (array-like, optional): The second data matrix.
            gamma_h (float, optional): The gamma parameter for high-quality kernel.

        Returns:
            array: The computed kernel matrix.
        """
        params = {'gamma': gamma_h}
        return pairwise_kernels(X, Y, metric='rbf', filter_params=True, **params)


ARGS = {
    'delta_scale': 'auto',
    'delta_exp': 'auto',
    'alpha_scale': 'auto',
    'alpha_scales': 'auto',
    'n_alphas': 10,
    'kernel': 'rbf',
    'kernel_params': None,
    'gamma': 0.1,
    'degree': 3,
    'coef0': 1.0,
    'gamma_gm': 'auto',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _BaseRKHSIV — 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 _BaseRKHSIV 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
_check_auto Ran
ran, violated the contract we drafted
yezichu/pcl_continuous_treatment/model/rkhs/rkhs_approx.py
code served (permissive licence) · get_code("74b8788cadceeabe")
How it ran

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

import torch
import numpy as np

torch.manual_seed(0)

# The function _check_auto takes a single parameter and checks if it's the string 'auto'
# We need to provide a value for the 'param' argument

# Test case 1: param is the string 'auto'
param_value = 'auto'

ARGS = {
    'param': param_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ApproxRKHSIV Not yet run
unverified (harvested, no recorded run)
yezichu/pcl_continuous_treatment/model/rkhs/rkhs_approx.py
code served (permissive licence) · get_code("10dbf3abedb630ca")
How it ran

no invocation recorded.

binaryKernel Not yet run
unverified (harvested, no recorded run)
yezichu/pcl_continuous_treatment/utils/kernel.py
code served (permissive licence) · get_code("985c1940e086a2ad")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

epanechnikov_kernel Not yet run
unverified (harvested, no recorded run)
yezichu/pcl_continuous_treatment/utils/kernel.py
code served (permissive licence) · get_code("ec83531ba296e098")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

gaussian_kernel Not yet run
unverified (harvested, no recorded run)
yezichu/pcl_continuous_treatment/utils/kernel.py
code served (permissive licence) · get_code("ed2c5f8630d24404")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

Also present in other papers' code

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

Proximal causal learning is a powerful framework for identifying the causal effect under the existence of unmeasured confounders. Within this framework, the doubly robust (DR) estimator was derived and has shown its effectiveness in estimation, especially when the model assumption is violated. However, the current form of the DR estimator is restricted to binary treatments, while the treatments can be continuous in many real-world applications. The primary obstacle to continuous treatments resides in the delta function present in the original DR estimator, making it infeasible in causal effect estimation and introducing a heavy computational burden in nuisance function estimation. To address these challenges, we propose a kernel-based DR estimator that can well handle continuous treatments for proximal causal learning. Equipped with its smoothness, we show that its oracle form is a consistent approximation of the influence function. Further, we propose a new approach to efficiently solve the nuisance functions. We then provide a comprehensive convergence analysis in terms of the mean square error. We demonstrate the utility of our estimator on synthetic datasets and real-world applications 1 .

For agents

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

get_harvested_code_for_paper("2309.12819")
get_code_for_paper("2309.12819")
have("2309.12819")

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

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

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

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

Connect an agent — have() is free.