Simple hyperparameter optimization benchmark datasets
Project description
Simple HPO Benchmark Datasets
This repository provides a set of simple single-objective HPO benchmark datasets:
- HPOBench (Apache-2.0 License)
- HPOLib (BSD-3-Clause License)
- NAS-Bench-201 (MIT License)
Installation & Requirements
The requirements of this repository are:
- Python 3.8 or later
- NumPy
You can simply install the package via:
$ pip install simple-hpo-bench
Examples
Examples are available at examples/.
For example, HPOBench can be optimized by Optuna as follows:
from __future__ import annotations
from hpo_benchmarks import HPOBench
import optuna
# Instatiate the benchmark function.
bench = HPOBench(dataset_name="australian")
def objective(trial: optuna.Trial) -> list[float]:
params = {}
for param_name, choices in bench.search_space.items():
params[param_name] = choices[trial.suggest_int(f"{param_name}_index", low=0, high=len(choices) - 1)]
results = bench(params)
return [results[name] for name in bench.metric_names]
study = optuna.create_study(direction=[bench.directions[name] for name in bench.metric_names])
study.optimize(objective, n_trials=30)
For benchmark functions, the argument for these classes is only dim, which determines the dimension of the function.
For tabular benchmarks (HPOLib, HPOBench, and NASBench201), the arguments are:
dataset_name: one of the dataset names of the benchmark dataset of interest, andseed: the random seed for the benchmark dataset.
The available dataset names for each benchmark dataset are as follows:
| Benchmark Dataset | Available Dataset Names |
|---|---|
HPOLib |
naval_propulsion, parkinsons_telemonitoring, protein_structure, slice_localization |
HPOBench |
australian, blood_transfusion, car, credit_g, kc1, phoneme, segment, vehicle |
NASBench201 |
cifar10, cifar100, imagenet |
Search Space
In this section, bench is an instantiated benchmark.
The search space of the benchmark functions are [bench.param_range[0], bench.param_range[1]]^bench.dim.
The search space of HPOLib, HPOBench, and NASBench201 is defined in bench.search_space.
bench.search_space is a dict that takes param_name as a key and the corresponding possible choices as a value.
bench.param_types defines the types of each parameter.
int is for an integer parameter, str is for a categorical parameter, and float is for a non-integer numerical parameter.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simple_hpo_bench-0.2.0-py3-none-any.whl.
File metadata
- Download URL: simple_hpo_bench-0.2.0-py3-none-any.whl
- Upload date:
- Size: 36.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f76495fa70fa96c234c4bc3ad18c8e8283bec4c2f66f08ef59071b1d286d720
|
|
| MD5 |
c847f2003f712a309bf91ed9d9e49fd5
|
|
| BLAKE2b-256 |
ece3799b57c24ae86dc4c79468fde3e23e3d4133f2b070e1eadf780421c26fbe
|