This is the code for Optimization of time-consuming experimental conditions using pseudo-experimental data guided by adaptive polynomial regression. This project is carried out in Funahashi Lab. at Keio University.
PolyBO targets optimization settings where each real experiment is expensive and only a small number of observations can be collected. An overview diagram of PolyBO is shown below.
- Python 3.10
- uv for environment and dependency management
Core Python dependencies are pinned in pyproject.toml, including:
- Clone this repository:
git clone https://github.com/funalab/PolyBO.git
cd PolyBO- Install the dependencies:
uv sync- Run PolyBO for one BBOB function at
D=20:
This command runs the main BBOB paper setting for BBOB_1 and writes results to
outputs/bbob_paper/poly/d20/BBOB_1.
uv run python -m src.main \
settings.type=poly benchmark=BBOB_1 dim=20 seeds=30 max_iter=100 \
n_init=2 n_pseudo=10 +poly.degree=4- Run vanilla BO for the same setting:
uv run python -m src.main \
settings.type=vanilla benchmark=BBOB_1 dim=20 seeds=30 max_iter=100 \
n_init=2 n_pseudo=10- Run random sampling for the same setting:
uv run python -m src.random_search \
settings.type=random benchmark=BBOB_1 dim=20 seeds=30 max_iter=100 \
n_init=2All experiment entry points use CUDA automatically when PyTorch can see an
available GPU; otherwise they fall back to CPU. On multi-GPU machines, prefix
any command in this README with CUDA_VISIBLE_DEVICES to choose the physical GPU
index shown by nvidia-smi:
CUDA_VISIBLE_DEVICES=0 uv run python -m src.main \
settings.type=poly benchmark=BBOB_1 dim=20 seeds=30 max_iter=100 \
n_init=2 n_pseudo=10 +poly.degree=4The main BBOB setting in the manuscript is:
- BBOB functions:
BBOB_1toBBOB_24 - dimensions:
2,5,10, and20 - seeds:
1to30 - initial observations:
n_init=2 - BO iterations:
max_iter=100 - acquisition function: expected improvement (
EI) - PolyBO hyperparameters:
p=4,m=10
Set the BBOB function list:
BBOB_FUNCTIONS=BBOB_1,BBOB_2,BBOB_3,BBOB_4,BBOB_5,BBOB_6,BBOB_7,BBOB_8,BBOB_9,BBOB_10,BBOB_11,BBOB_12,BBOB_13,BBOB_14,BBOB_15,BBOB_16,BBOB_17,BBOB_18,BBOB_19,BBOB_20,BBOB_21,BBOB_22,BBOB_23,BBOB_24Run PolyBO for all 24 BBOB functions at D=20:
uv run python -m src.main --multirun \
settings.type=poly dim=20 seeds=30 max_iter=100 n_init=2 n_pseudo=10 \
+poly.degree=4 benchmark=${BBOB_FUNCTIONS}Run vanilla BO for all 24 BBOB functions at D=20:
uv run python -m src.main --multirun \
settings.type=vanilla dim=20 seeds=30 max_iter=100 n_init=2 n_pseudo=10 \
benchmark=${BBOB_FUNCTIONS}Run random sampling for all 24 BBOB functions at D=20:
uv run python -m src.random_search --multirun \
settings.type=random dim=20 seeds=30 max_iter=100 n_init=2 \
benchmark=${BBOB_FUNCTIONS}Repeat these commands with dim=2, dim=5, and dim=10 to reproduce the
other BBOB dimensions reported in the manuscript.
After the BBOB CSV files have been generated, all 24 BBOB optimization-process plots for one dimension can be created with:
uv run --extra analysis python -m src.plot_bbob_process --dimension 20This reads the default output layout from outputs/bbob_paper and writes
per-function PDFs and a 24-function summary PDF to outputs/bbob_figures/d20.
For a quick check with only F01 and F02:
uv run --extra analysis python -m src.plot_bbob_process --dimension 20 --benchmarks 1,2The HEA benchmark is included as an executable benchmark path, but the public figure-generation workflow currently focuses on the BBOB optimization-process plots.
The HEA benchmark path runs discrete Bayesian optimization over 10-dimensional
high-entropy-alloy compositions using the bundled pretrained CNN-DNN property
predictors. By default, src.main_discrete uses the fixed initial conditions in
data/hea_bo_init.csv; the HEA manuscript setting uses 20 initial compositions
per seed, 1,480 BO iterations, and seeds=30, giving 1,500 total experimental
evaluations per seed.
Run PolyBO on the HEA benchmark with the manuscript setting:
uv run python -m src.main_discrete hydra=hea settings.type=poly benchmark=HEA_FOM dim=10 seeds=30 max_iter=1480 n_init=20 n_pseudo=10 +poly.degree=4The development of this algorithm was funded by JST CREST (Grant Number JPMJCR21N1) to Akira Funahashi.
Parts of the HEA benchmark implementation and pretrained model assets in this repository are adapted from RLvsBO4Materials, which accompanies Unlocking the black box beyond Bayesian global optimization for materials design using reinforcement learning (npj Computational Materials, 2025). The HEA surrogate model architecture and underlying alloy-design data are based on A neural network model for high entropy alloy design (npj Computational Materials, 2023).
This project is distributed under the MIT License. See LICENSE for details.
