Skip to main content

Bayesian Optimization by Density-Ratio Estimation

Project description

BORE: Bayesian Optimization as Density-Ratio Estimation

https://img.shields.io/pypi/v/bore.svg https://img.shields.io/travis/ltiao/bore.svg Documentation Status Updates

A minimalistic implementation of BORE: Bayesian Optimization as Density-Ratio Estimation [1] in Python 3 and TensorFlow 2.

Getting Started

Install my-project with npm

$ pip install bore[tf]

With GPU acceleration:

$ pip install bore[tf-gpu]

With support for HpBandSter plugin

$ pip install bore[tf,hpbandster]

Usage/Examples

from bore.models import MaximizableSequential
from tensorflow.keras.layers import Dense

# build model
classifier = MaximizableSequential()
classifier.add(Dense(16, activation="relu"))
classifier.add(Dense(16, activation="relu"))
classifier.add(Dense(1, activation="sigmoid"))

# compile model
classifier.compile(optimizer="adam", loss="binary_crossentropy")

The optimization loop can be implemented as follows:

import numpy as np

features = []
targets = []

# initial design
features.extend(features_init)
targets.extend(targets_init)

for i in range(num_iterations):

    # construct classification problem
    X = np.vstack(features)
    y = np.hstack(targets)

    tau = np.quantile(y, q=0.25)
    z = np.less(y, tau)

    # update classifier
    classifier.fit(X, z, epochs=200, batch_size=64)

    # suggest new candidate
    x_next = classifier.argmax(method="L-BFGS-B", num_start_points=3, bounds=bounds)

    # evaluate blackbox function
    y_next = blackbox.evaluate(x_next)

    # update dataset
    features.append(x_next)
    targets.append(y_next)

Features

  • BORE-MLP: BORE based on a multi-layer perceptron (MLP) (i.e. a fully-connected neural network) classifier

Roadmap

  • Integration with the Optuna framework by Sampler plugin implementation.

Authors

Lead Developers:

tiao

klein

Louis Tiao

Aaron Klein

https://tiao.io/

https://aaronkl.github.io/

Reference

Cite:

@inproceedings{tiao2021-bore,
  title={{B}ayesian {O}ptimization by {D}ensity-{R}atio {E}stimation},
  author={Tiao, Louis and Klein, Aaron and Archambeau, C\'{e}dric and Bonilla, Edwin V and Seeger, Matthias and Ramos, Fabio},
  booktitle={Proceedings of the 38th International Conference on Machine Learning (ICML2021)},
  address={Virtual (Online)},
  year={2021},
  month={July}
}

License

MIT License

Copyright (c) 2021, Louis C. Tiao

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

History

0.1.0 (2019-12-27)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bore-1.1.0.tar.gz (22.1 kB view hashes)

Uploaded Source

Built Distribution

bore-1.1.0-py2.py3-none-any.whl (15.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page