Skip to main content


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

This project is now supported by PengCheng Lab.


Overview | Links |Installation | Quick Start | Benchmark |Contributing | License

For more information and API usages, please refer to our Documentation.


Overview

XBBO decouples the search algorithm from the search space and provides a unified search space interface, allowing developers to focus on the search algorithm.

We provide these black box optimization algorithms as follows:

Search Algorithm Docs Official Links multi-fideility transfer multi-obj
Random Random
Bayesian Optimization BO
TPE TPE hyperopt
BORE BORE ltiao/bore
Anneal Anneal
CEM CEM
Diffenential Evolution DE
CMA-ES CMA-ES CMA-ES/pycma
NSGA-II √
Regularized EA REA Google-Research
PBT
TuRBO TuRBO
LaMCTS LaMCTS facebookresearch
HyperBand √
BOHB √
DEHB √
MFES-BO √
TST-R √
TAF √
TAF(RGPE) √
RMoGP √
RGPE(mean) √
PSO
XNES
LFBO LFBO lfbo-ml/lfbo

Links

Installation

Python >= 3.7 is required.

Installation from PyPI

To install XBBO from PyPI:

pip install xbbo

For detailed instructions, please refer to Installation.md

Search Space

XBBO uses ConfigSpace as a tool to define search space. Please see ConfigSpace for how to define a search space.

Quick Start

note:XBBO default minimize black box function. All examples can be found in examples/ folder.

Here we take optimizing a quadratic function as a toy example:

from ConfigSpace import ConfigurationSpace
from ConfigSpace.hyperparameters import \
    CategoricalHyperparameter, UniformFloatHyperparameter, UniformIntegerHyperparameter

from xbbo.search_algorithm.bo_optimizer import BO

def custom_black_box_func(config):
    '''
    define black box function:
    y = x^2
    '''
    return config['x'] ** 2

def custom_search_space():
    '''
    define search space
    '''
    configuration_space = ConfigurationSpace()
    configuration_space.add_hyperparameter(UniformFloatHyperparameter('x', -10, 10, default_value=-3))
    return configuration_space

if __name__ == "__main__":
    MAX_CALL = 30

    cs = custom_search_space()

    # specify black box optimizer
    hpopt = BO(space=cs, suggest_limit=MAX_CALL)
    # ---- Begin BO-loop ----
    for i in range(MAX_CALL):
        # suggest
        trial_list = hpopt.suggest() # defalut suggest one trial
        # evaluate 
        obs = custom_black_box_func(trial_list[0].config_dict)
        # observe
        trial_list[0].add_observe_value(obs)
        hpopt.observe(trial_list=trial_list)
        
        print(obs)
    
    print('find best (value, config):{}'.format(hpopt.trials.get_best()))

Please refer to Quick Start.md for more information.

Benchmark

XBBO provides an easy-to-use benchmark tool, users can easily and quickly test the performance of the variety black-box algorithms on each test problem. Clik here for more information.

Contributing

We welcome contributions to the library along with any potential issues or suggestions.

Please refer to Contributing.md in our docs for more information.

License

This project is released under the MIT license.

TODO

  • 文档完善
  • Logger
  • parallel

Metadata

Release files for XBBO 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for XBBO 0.3.3
File Size Uploaded
XBBO-0.3.3.tar.gz 141.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for XBBO 0.3.3
File Interpreter ABI Platform
XBBO-0.3.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 334.1 kB

Release files / XBBO-0.3.3.tar.gz

Download URL XBBO-0.3.3.tar.gz
Size 141.5 kB
Tags Source
SHA-256 checksum
How to use checksums
795ce05e9ead5fc6c61a7ee6859a7085fd57005002d8207b04ed2da0cfb63daf
BLAKE2b-256 checksum
How to use checksums
1818440c2828cb0173a4ec82470ef5285bacbef729cfddd072bdf8f0a3744d66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / XBBO-0.3.3-py2.py3-none-any.whl

Download URL XBBO-0.3.3-py2.py3-none-any.whl
Size 192.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
19ece4e90670816b45e0d899efac04448c2836cd367b212a20b0053414cdbcba
BLAKE2b-256 checksum
How to use checksums
4c9adf1751b6f13201a3f8794b455d9d305869ec771eecee42aaccef3d855794
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.2.9

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page