Skip to main content

Bayesian Optimization Hyperband Hyperparameter Optimization

Project description

Bayesian Optimization Hyperband Hyperparameter Optimization

Implementation for BOHB

Requirements

- numpy
- scipy
- statsmodels
- torch (example)

Installation

pip3 install bohb-hpo

Usage

from bohb import BOHB
import bohb.configspace as cs


def objective(step, alpha, beta):
    return 1 / (alpha * step + 0.1) + beta


def evaluate(params, n_iterations):
    loss = 0.0
    for i in range(int(n_iterations)):
        loss += objective(**params, step=i)
    return loss/n_iterations


alpha = cs.CategoricalHyperparameter('alpha', [0.001, 0.01, 0.1])
beta = cs.CategoricalHyperparameter('beta', [1, 2, 3])
configspace = cs.ConfigurationSpace([alpha, beta], seed=123)

opt = BOHB(configspace, evaluate, max_budget=10, min_budget=1)
logs = opt.optimize()

See examples

TODO

- Parallel Optimization (Implemented but not working properly)
- More Hyperparameters

License

bohb-hpo is licensed under the MIT License.

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

BOHB_HPO-0.2.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BOHB_HPO-0.2.0-py3.8.egg (13.8 kB view details)

Uploaded Egg

File details

Details for the file BOHB_HPO-0.2.0.tar.gz.

File metadata

  • Download URL: BOHB_HPO-0.2.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.4.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for BOHB_HPO-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5b66dabd1771fffc3977443eedeb4fb5581443bb0f75a4c11b3da800e05210dc
MD5 ad7dd6499111da714c944b4c0957ebc7
BLAKE2b-256 ad4e9698da447b8ccec3545f119d5b17179cd8dbdd4cfb28001ec4f306d90234

See more details on using hashes here.

File details

Details for the file BOHB_HPO-0.2.0-py3.8.egg.

File metadata

  • Download URL: BOHB_HPO-0.2.0-py3.8.egg
  • Upload date:
  • Size: 13.8 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.4.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for BOHB_HPO-0.2.0-py3.8.egg
Algorithm Hash digest
SHA256 91e49c661bc72adb2b6dc94a546e88d0ae3756b4a6bef2aec65ed7f3f6942456
MD5 ad3e7a53fd2a11423ad6547f636a4397
BLAKE2b-256 b347ffbc2e8cf97bf5cd3747dc5227f3d7e0c0b64d4bd15f539e2d11695cd4df

See more details on using hashes here.

Supported by

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