SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.03637 · 2021

Risk-averse Heteroscedastic Bayesian Optimization

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, 0 violated it and 9 have no contract verdict; 0 failures of our instrument; 1 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/2111.03637.json · badge: /api/ran/2111.03637.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
avidereta/risk-averse-hetero-bo canonical (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
FunctionStatusWhere it lives
evaluate_rho_mean Ran
ran on a synthesized input
avidereta/risk-averse-hetero-bo/rahbo/optimization/bo_loop.py
code served (permissive licence) · get_code("420e987d372e2337")
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 2, dtype family float, shape (2, 2) 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)

# Create a minimal mock GP model that satisfies the function's usage
class MockGP(nn.Module):
    def __init__(self):
        super().__init__()
        self.register_buffer('_dummy', torch.tensor(1.0))
    
    def posterior(self, x):
        # x is nmb_points x dim
        # posterior().mean should return nmb_points x 1
        nmb_points = x.shape[0]
        mean = torch.abs(torch.randn(nmb_points, 1)) + 0.1
        return MockPosterior(mean)

class MockPosterior:
    def __init__(self, mean):
        self.mean = mean

# Construct arguments
x = torch.randn(2, 4)  # 2 points, 4 dimensions
gp_var = MockGP()
gamma = 5  # scalar coefficient
repeat_eval = 2

ARGS = {
    "x": x,
    "gp_var": gp_var,
    "gamma": gamma,
    "repeat_eval": repeat_eval,
}
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 2, dtype family float, shape (2, 2) — shape (2, 2) 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_data Ran
ran on a synthesized input
avidereta/risk-averse-hetero-bo/rahbo/test_functions/fel.py
code served (permissive licence) · get_code("28b100e428b95d4d")
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 os
import numpy as np
import h5py
import json
import tempfile
import shutil

# Create a temporary directory structure with required files
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data')
sf_dir = os.path.join(temp_dir, 'sf')
os.makedirs(data_dir, exist_ok=True)
os.makedirs(sf_dir, exist_ok=True)

# Create evaluations.hdf5 file
hdf5_path = os.path.join(data_dir, 'evaluations.hdf5')
with h5py.File(hdf5_path, 'w') as f:
    group_0 = f.create_group('0')
    group_0.attrs['algorithm'] = 'test_algorithm'
    
    # Create run 0 with sample data
    run_data = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
    group_0.create_dataset('0', data=run_data)

# Create x0.json file
x0_path = os.path.join(sf_dir, 'x0.json')
x0_data = [0.1, 0.2, 0.3, 0.4]
with open(x0_path, 'w') as f:
    json.dump(x0_data, f)

ARGS = {
    'path': temp_dir,
    'run': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py, numpy — 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
get_observation_with_learnt_rho Ran
ran on a synthesized input
avidereta/risk-averse-hetero-bo/rahbo/optimization/bo_loop.py
code served (permissive licence) · get_code("c3e7c0c72b91e876")
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 2, dtype family float, shape (2, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small stand-in class for gp_varproxi
class GPVarProxiMock(nn.Module):
    def __init__(self, input_dim=4, output_dim=1):
        super().__init__()
        self.input_dim = input_dim
        self.output_dim = output_dim
        self.linear = nn.Linear(input_dim, output_dim)
    
    def posterior(self, x):
        """Returns a posterior object with a mean attribute"""
        mean = self.linear(x)
        return PosteriorMock(mean)

class PosteriorMock:
    def __init__(self, mean):
        self.mean = mean

# Create a small stand-in class for cv_function
class CVFunctionMock(nn.Module):
    def __init__(self, input_dim=4, output_dim=3):
        super().__init__()
        self.input_dim = input_dim
        self.output_dim = output_dim
        self.linear = nn.Linear(input_dim, output_dim)
    
    def __call__(self, x):
        return self.linear(x)

# Create test arguments
x = torch.randn(2, 4)  # batch_size=2, feature_dim=4
gp_varproxi = GPVarProxiMock(input_dim=4, output_dim=1)
cv_function = CVFunctionMock(input_dim=4, output_dim=3)
gamma = 0.5

ARGS = {
    "x": x,
    "gp_varproxi": gp_varproxi,
    "cv_function": cv_function,
    "gamma": gamma
}
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 2, dtype family float, shape (2, 3) — shape (2, 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
plot_hist_f_rho Ran
ran on a synthesized input
avidereta/risk-averse-hetero-bo/helper_fns/plotting_utils.py
code served (permissive licence) · get_code("e87b63840e8987eb")
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 matplotlib.cm as cm

# Create sample data for the df parameter
# df should be a dict with method names as keys and dicts containing 'fs' and 'rhos' arrays as values
df = {
    'raucb_gamma0.5': {
        'fs': np.random.randn(50),
        'rhos': np.random.uniform(0, 1, 50)
    },
    'raucb_gamma1': {
        'fs': np.random.randn(50),
        'rhos': np.random.uniform(0, 1, 50)
    },
    'ucb': {
        'fs': np.random.randn(50),
        'rhos': np.random.uniform(0, 1, 50)
    }
}

# Create color array
color = cm.Dark2(np.linspace(0, 1, len(df)))

# Create linestyles
linestyles = ['-', '--', '-.']

# Create labels dict (subset of the global labels)
labels_dict = {
    'raucb_gamma0.5': 'RAHBO $\\alpha=0.5$',
    'raucb_gamma1': 'RAHBO $\\alpha=1$',
    'ucb': 'GP-UCB'
}

ARGS = {
    'df': df,
    'bw_f': 0.3,
    'bw_rho': 0.1,
    'title': 'Test F-Rho Distribution',
    'path_to_save': None,
    'color': color,
    'linestyles': linestyles,
    'flims': (-3, 3),
    'rholims': (0, 1),
    'labels': labels_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, seaborn — 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
plot_objectives Ran
ran on a synthesized input
avidereta/risk-averse-hetero-bo/helper_fns/plotting_utils.py
code served (permissive licence) · get_code("90942a5fc32233d8")
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
from matplotlib import pyplot as plt

# Close any existing plots to avoid interference
plt.close('all')

# Construct valid arguments for plot_objectives
objectives = {
    'loss': np.array([2.5, 2.3, 2.1, 1.9, 1.8, 1.7, 1.6]),
    'accuracy': np.array([0.5, 0.6, 0.65, 0.7, 0.72, 0.75, 0.78]),
    'f1_score': np.array([0.4, 0.5, 0.55, 0.6, 0.62, 0.65, 0.68])
}

path_to_save = None

thresholds = {
    'loss': 1,
    'accuracy': 0,
    'f1_score': 2
}

objective_name = 'Metric Value'

title = 'Bayesian Optimization Progress'

ARGS = {
    'objectives': objectives,
    'path_to_save': path_to_save,
    'thresholds': thresholds,
    'objective_name': objective_name,
    'title': title
}
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 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
plot_objectives_mean_std Ran
ran on a synthesized input
avidereta/risk-averse-hetero-bo/helper_fns/plotting_utils.py
code served (permissive licence) · get_code("be5403f057684c73")
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
from matplotlib import pyplot as plt

# Create sample objectives data
# objectives should be a dict where each value is a 2D numpy array
# with shape (n_iterations, n_runs) for computing mean and std

objectives = {
    'Method_A': np.random.randn(10, 5),  # 10 iterations, 5 runs
    'Method_B': np.random.randn(10, 5),  # 10 iterations, 5 runs
    'Method_C': np.random.randn(10, 5),  # 10 iterations, 5 runs
}

# Create thresholds dict (optional filtering of early iterations)
thresholds = {
    'Method_A': 0,
    'Method_B': 1,
    'Method_C': 2,
}

# Create custom colors and linestyles as dicts
color_dict = {
    'Method_A': [0.2, 0.3, 0.7, 1.0],
    'Method_B': [0.8, 0.2, 0.2, 1.0],
    'Method_C': [0.2, 0.8, 0.2, 1.0],
}

linestyles_dict = {
    'Method_A': '-',
    'Method_B': '--',
    'Method_C': '-.',
}

ARGS = {
    'objectives': objectives,
    'path_to_save': None,
    'thresholds': thresholds,
    'objective_name': 'Objective Value',
    'title': 'Comparison of Optimization Methods',
    'color': color_dict,
    'linestyles': linestyles_dict,
    'legend': True,
    'yscale': None,
    'ylim': 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 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
report_idx_max_mv Ran
ran on a synthesized input
avidereta/risk-averse-hetero-bo/helper_fns/reporting_rules_postprocess.py
code served (permissive licence) · get_code("f258426a0effcca1")
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 int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Create a small DataFrame with 'ymean' and 'yvar' columns
np.random.seed(0)
resdf = pd.DataFrame({
    'ymean': np.array([0.1, 0.3, 0.25, 0.4, 0.35]),
    'yvar': np.array([0.05, 0.08, 0.06, 0.07, 0.09])
})

gamma = 0.5

ARGS = {
    'resdf': resdf,
    'gamma': gamma
}
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 list, ndim 1, dtype family int — 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
report_idx_max_ymean Ran
ran on a synthesized input
avidereta/risk-averse-hetero-bo/helper_fns/reporting_rules_postprocess.py
code served (permissive licence) · get_code("2082fb24073365a7")
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 int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Create a simple DataFrame with 'ymean' column
# The function expects a pd.DataFrame with a 'ymean' column
ymean_values = np.array([0.5, 0.7, 0.6, 0.9, 0.8, 0.95])
resdf = pd.DataFrame({'ymean': ymean_values})

ARGS = {
    'resdf': resdf
}
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 list, ndim 1, dtype family int — 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
transform_x_to_tensor Ran
ran on a synthesized input
avidereta/risk-averse-hetero-bo/helper_fns/reporting_rules_postprocess.py
code served (permissive licence) · get_code("710478242bc82d69")
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 2, dtype family float, shape (2, 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 torch
from torch import Tensor

torch.manual_seed(0)

# The function expects df_values to be an iterable of iterables of tensors
# It vstacks the results of hstacking each inner group
# So df_values should be a list of lists of tensors

# Create a small example: 2 points, each composed of 2 tensors of dimension 2
# This gives us flexibility to test the stacking behavior
x1_point1 = torch.tensor([[1.0, 2.0]])  # shape (1, 2)
x2_point1 = torch.tensor([[3.0, 4.0]])  # shape (1, 2)

x1_point2 = torch.tensor([[5.0, 6.0]])  # shape (1, 2)
x2_point2 = torch.tensor([[7.0, 8.0]])  # shape (1, 2)

df_values = [
    [x1_point1, x2_point1],  # point 1: hstack gives (1, 4)
    [x1_point2, x2_point2],  # point 2: hstack gives (1, 4)
]

ARGS = {
    "df_values": df_values
}
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 2, dtype family float, shape (2, 4) — shape (2, 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_observation_with_learnt_rho Not yet run
unverified (harvested, no recorded run)
avidereta/risk-averse-hetero-bo/rahbo/optimization/bo_loop_synthetic.py
code served (permissive licence) · get_code("8dd73bff5f65ce7d")
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, 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 10 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

Many black-box optimization tasks arising in high-stakes applications require risk-averse decisions. The standard Bayesian optimization (BO) paradigm, however, optimizes the expected value only. We generalize BO to trade mean and input-dependent variance of the objective, both of which we assume to be unknown a priori. In particular, we propose a novel risk-averse heteroscedastic Bayesian optimization algorithm (RAHBO) that aims to identify a solution with high return and low noise variance, while learning the noise distribution on the fly. To this end, we model both expectation and variance as (unknown) RKHS functions, and propose a novel risk-aware acquisition function. We bound the regret for our approach and provide a robust rule to report the final decision point for applications where only a single solution must be identified. We demonstrate the effectiveness of RAHBO on synthetic benchmark functions and hyperparameter tuning tasks.

For agents

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

get_harvested_code_for_paper("2111.03637")
get_code_for_paper("2111.03637")
have("2111.03637")

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

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

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

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

Connect an agent — have() is free.