启智社区最近又发版了,新增模型推理功能,欢迎大家体验>>>
You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
isleizhang 194f674201 Merge pull request 'add hyperband notes' (#32) from dev into master 1 day ago
cfgs add hyperopt comparison 5 days ago
docs add hyperband notes 1 day ago
examples fix bore bugs and add bore benchmark 3 days ago
offline_evaluations 增加剩余Transfer BO 4 months ago
out add hyperopt comparison 5 days ago
tests add BayesianOptimization benchmark 2 days ago
xbbo fix bore bugs and add bore benchmark 3 days ago
.gitignore add LICENSE 3 weeks ago
LICENSE add LICENSE 3 weeks ago
README.md add hyperband notes 1 day ago
requirements.txt add SMAC3 comparison 3 weeks ago

README.md

XBBO

XBBO is an an effective, modular and flexible black-box optimization (BBO) codebase, which aims to provide a common framework and benchmark for the BBO community.

Installation

Python >= 3.8 is required.

git clone REPO_URL
cd XBBO
# install requirements
pip install -r ./requirements.txt
# set root path
export PYTHONPATH=$PYTHONPATH:/Path/to/XBBO

Quick Start

Bayesian Optimization test

python ./examples/rosenbrock_bo.py

note:XBBO default minimize black box function.

def build_space(rng):
    cs = DenseConfigurationSpace(seed=rng.randint(10000))
    x0 = UniformFloatHyperparameter("x0", -5, 10, default_value=-3)
    x1 = UniformFloatHyperparameter("x1", -5, 10, default_value=-4)
    cs.add_hyperparameters([x0, x1])
    return cs

rng = np.random.RandomState(42)
# define black box function
blackbox_func = rosenbrock_2d
# define search space
cs = build_space(rng)
# define black box optimizer
hpopt = BO(config_spaces=cs, seed=rng.randint(10000), total_limit=MAX_CALL)
# Example call of the black-box function
def_value = blackbox_func(cs.get_default_configuration())
print("Default Value: %.2f" % def_value)
# ---- Begin BO-loop ----
for i in range(MAX_CALL):
    # suggest
    trial_list = hpopt.suggest()
    # evaluate 
    value = blackbox_func(trial_list[0].config_dict)
    # observe
    trial_list[0].add_observe_value(observe_value=value)
    hpopt.observe(trial_list=trial_list)
    
    print(value)  

All examples can be found in examples/ folder.

Supported Algorithms

Benchmark

Run tests/xbbo_benchmark.py to benchmark general BBO optimizer.

Method Minimum Best minimum Mean f_calls to min Std f_calls to min Fastest f_calls to min
XBBO(rs) 0.684+/-0.248 0.399 110.4 60.511 17
XBBO(bo-gp) 0.398+/-0.000 0.398 42.0 5.0398 30
XBBO(tpe) 0.519+/-0.119 0.398 191.4 12.035 162
XBBO(anneal) 0.403+/-0.004 0.398 161.1 18.839 126
XBBO(rea) 2.541+/-3.945 0.409 121.0 86.864 7
XBBO(de) 0.412+/-0.038 0.398 148.2 35.21 100
XBBO(turbo-1) 0.398+/-0.000 0.398 110.3 46.596 46
XBBO(turbo-2) 0.398+/-0.000 0.398 130.7 48.57 68
XBBO(bore) 0.408+/-0.006 0.401 117.4 58.114 38

Compare other bbo library

Here you can comparison with commonly used and well-known Hyperparameter Optimization (HPO) packages:

SMAC3

hyperopt

scikit-optimize

TuRBO

Bayesian Optimization

Algorithms notes

review

TODO

简介

黑盒优化框架

Python Markdown Pickle