SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2001.06814 · 2020

Distributionally Robust Bayesian Quadrature Optimization

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 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 8 have no contract verdict; 0 failures of our instrument; 0 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/2001.06814.json · badge: /api/ran/2001.06814.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
thanhnguyentang/drbqo canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
TS_posterior_func_sample Ran
ran on a synthesized input
thanhnguyentang/drbqo/acqs/TS.py
code served (permissive licence) · get_code("1000098e89c25373")
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

class MockGPModel:
    """Mock GP model with required methods"""
    def __init__(self):
        self._noise_variance = 0.01
        self._variance = 2.0
        self._lengthscale = np.array([0.5, 0.6, 0.7, 0.8])
    
    def _get_Gaussian_noise_variance(self):
        return self._noise_variance
    
    def _get_variance(self):
        return self._variance
    
    def _get_lengthscale(self):
        return self._lengthscale

# Create training data: 5 samples, 4 features
np.random.seed(0)
X_train = np.random.randn(5, 4).astype(np.float64)
Y_train = np.random.randn(5, 1).astype(np.float64)

ARGS = {
    'model': MockGPModel(),
    'm': 10,
    'n_fs': 2,
    'data': (X_train, Y_train),
    'kernel_type': 'RBF'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
Thomson_sampling Ran
ran on a synthesized input
thanhnguyentang/drbqo/acqs/TS.py
code served (permissive licence) · get_code("c0303d8afd1621a7")
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

class SpectralDensitySampler:
    """Stand-in spectral density sampler that returns random weights."""
    def sample(self, m):
        """
        Sample m weight vectors from the spectral density.
        Returns shape (m, d) where d is the input dimension.
        """
        d = 3  # input dimension
        return np.random.randn(m, d)

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

# Create small training data
n_samples = 2  # number of training samples
input_dim = 3  # input dimension
X_train = np.random.randn(n_samples, input_dim)
Y_train = np.random.randn(n_samples, 1)
data = (X_train, Y_train)

# Create the spectral density sampler
sd_sampler = SpectralDensitySampler()

ARGS = {
    "alpha": 1.0,  # scaling constant for kernel
    "sigma_n": 0.1,  # noise standard deviation
    "sd_sampler": sd_sampler,  # spectral density sampler instance
    "data": data,  # tuple of (X_train, Y_train)
    "m": 4,  # number of random features
    "n_fs": 2,  # number of posterior function samples
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
latin_hypercube_sampler Ran
ran on a synthesized input
thanhnguyentang/drbqo/optimizer/lbfgs.py
code served (permissive licence) · get_code("d8c0cb14f0f56caf")
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 (5, 3) 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

ARGS = {
    'n': 5,
    'indim': 3,
    'bounds': np.array([[0.0, 1.0], [0.0, 2.0], [1.0, 3.0]]),
    'rng': np.random.RandomState(42)
}
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 (5, 3) — shape (5, 3) 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
min_weighted_sum_with_weights_on_chi_squared_ball Ran
ran on a synthesized input
thanhnguyentang/drbqo/utils/compute_dr_weight.py
code served (permissive licence) · get_code("550899ab385771a0")
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

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

# Create a small weight vector
w = np.array([1.5, 2.3, 0.8, 3.1])

# Create gradient with respect to w (same shape as w, but with additional dimension for batch)
# The function expects dw to be 2D based on usage: dw[ind_map] and dw[0, :]
dw = np.random.randn(4, 2)

# Parameters for the function
rho = 0.1  # constraint parameter for chi-squared ball
tol = 1e-10  # tolerance for numerical comparisons
return_grad = True  # whether to return gradients

ARGS = {
    'w': w,
    'dw': dw,
    'rho': rho,
    'tol': tol,
    'return_grad': return_grad
}
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 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
minimize Ran
ran on a synthesized input
thanhnguyentang/drbqo/optimizer/lbfgs.py
code served (permissive licence) · get_code("94c086615b7379a9")
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 scipy.optimize

def ensure_rng(random_state=None):
    """
    Creates a random number generator based on an optional seed.  This can be
    an integer or another random state for a seeded rng, or None for an
    unseeded rng.
    """
    if random_state is None:
        random_state = np.random.RandomState()
    elif isinstance(random_state, int):
        random_state = np.random.RandomState(random_state)
    else:
        assert isinstance(random_state, np.random.RandomState)
    return random_state

def random_sampler(n=1, indim=1, bounds=None, rng=None):
    rng = ensure_rng(rng)
    if bounds is None:
        bounds = np.zeros((indim, 2))
        bounds[:, 1] = 1.0
    return rng.uniform(bounds[:, 0], bounds[:, 1], (n, indim))

def latin_hypercube_sampler(n=1, indim=1, bounds=None, rng=None):
    """Latin Hypercube sampling."""
    rng = ensure_rng(rng)
    if bounds is None:
        bounds = np.zeros((indim, 2))
        bounds[:, 1] = 1.0
    hypercubes = np.linspace(bounds[:, 0], bounds[:, 1], n + 1)
    l = hypercubes[:-1, :].reshape(-1)
    u = hypercubes[1:, :].reshape(-1)
    _x = rng.uniform(l, u, (1, indim * n)).reshape(n, indim)
    x = _x
    for j in range(indim):
        x[:, j] = _x[rng.permutation(n), j]
    return x

# Create a simple objective function that returns both function values and gradients
def objective_func_with_grad(X):
    """
    Simple quadratic objective function.
    Returns (function_values, gradients) for batch evaluation.
    """
    if X.ndim == 1:
        X = X.reshape(1, -1)
    
    # Simple function: sum of squares
    func_vals = np.sum(X ** 2, axis=1)
    
    # Gradient: 2*X
    grads = 2 * X
    
    return func_vals, grads

def objective_func_no_grad(X):
    """
    Simple quadratic objective function without gradients.
    Returns only function values for batch evaluation.
    """
    if X.ndim == 1:
        X = X.reshape(1, -1)
    
    # Simple function: sum of squares
    func_vals = np.sum(X ** 2, axis=1)
    
    return func_vals

# Set up bounds for 4 dimensions, with different ranges
bounds = np.array([
    [-2.0, 2.0],
    [-1.5, 1.5],
    [-3.0, 3.0],
    [-1.0, 1.0]
])

ARGS = {
    "func": objective_func_with_grad,
    "bounds": bounds,
    "approx_grad": 0,
    "maxiter": 100,
    "n_warmup": 50,
    "n_restarts_optimizer": 3,
    "initializer": latin_hypercube_sampler,
    "x_init": np.array([0.5, 0.3, -0.2, 0.1]),
    "random_state": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
random_sampler Ran
ran on a synthesized input
thanhnguyentang/drbqo/optimizer/lbfgs.py
code served (permissive licence) · get_code("071d32de886a3166")
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 (5, 3) 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

ARGS = {
    'n': 5,
    'indim': 3,
    'bounds': np.array([[0.0, 1.0], [0.5, 2.0], [-1.0, 1.0]]),
    'rng': np.random.RandomState(42)
}
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 (5, 3) — shape (5, 3) 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
solve_inner_eta_for_weighted_sum Ran
ran on a synthesized input
thanhnguyentang/drbqo/utils/compute_dr_weight.py
code served (permissive licence) · get_code("ea28a573735d5d4f")
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 numpy as np

# Analyze the function:
# - w_sort_inc: used with indexing and in comparisons, appears to be a 1D numpy array
# - w_sort_inc_cumsum: used with indexing, appears to be a 1D numpy array (cumulative sum)
# - n: used as divisor in np.arange(1, n+1), should be an integer
# - lam: used in arithmetic, should be a scalar (>= 0)

# Create small test data
n = 5
w_sort_inc = np.array([-2.0, -1.5, -1.0, -0.5, 0.0])  # sorted in increasing order
w_sort_inc_cumsum = np.cumsum(w_sort_inc)  # cumulative sum
lam = 0.5  # lambda parameter

ARGS = {
    "w_sort_inc": w_sort_inc,
    "w_sort_inc_cumsum": w_sort_inc_cumsum,
    "n": n,
    "lam": lam,
}
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 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
suggest_explorative_w Ran
ran on a synthesized input
thanhnguyentang/drbqo/acqs/ei_quadrature.py
code served (permissive licence) · get_code("52036d222bcf70a8")
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 (1, 3) 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

class StandInGPModel:
    """Stand-in for a GPyTorch or similar model with predict method"""
    def predict(self, xw, full_cov=False, include_likelihood=True):
        # xw shape: (n_points, input_dim)
        n_points = xw.shape[0]
        # Return mean and variance
        m = np.random.randn(n_points, 1)
        v = np.abs(np.random.randn(n_points, 1)) + 0.1  # ensure positive variances
        return m, v

class StandInModel:
    """Stand-in model with w_domain and model attributes"""
    def __init__(self):
        # w_domain: shape (n_w_points, w_dim)
        self.w_domain = np.random.randn(5, 3)
        # Internal model with predict method
        self.model = StandInGPModel()

# Create the model
model = StandInModel()

# Create input x with shape (x_dim,)
x = np.random.randn(4)

ARGS = {
    "model": model,
    "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 2, dtype family float, shape (1, 3) — shape (1, 3) 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

Also present in other papers' code

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

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

Bayesian quadrature optimization (BQO) maximizes the expectation of an expensive black-box integrand taken over a known probability distribution. In this work, we study BQO under distributional uncertainty in which the underlying probability distribution is unknown except for a limited set of its i.i.d. samples. A standard BQO approach maximizes the Monte Carlo estimate of the true expected objective given the fixed sample set. Though Monte Carlo estimate is unbiased, it has high variance given a small set of samples; thus can result in a spurious objective function. We adopt the distributionally robust optimization perspective to this problem by maximizing the expected objective under the most adversarial distribution. In particular, we propose a novel posterior sampling based algorithm, namely distributionally robust BQO (DRBQO) for this purpose. We demonstrate the empirical effectiveness of our proposed framework in synthetic and real-world problems, and characterize its theoretical convergence via Bayesian regret.

For agents

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

get_harvested_code_for_paper("2001.06814")
get_code_for_paper("2001.06814")
have("2001.06814")

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

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

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

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

Connect an agent — have() is free.