Skip to content

PyHopper is a hyperparameter optimizer, made specifically for high-dimensional problems arising in machine learning research.

License

Notifications You must be signed in to change notification settings

pyhopper/pyhopper

Repository files navigation

PyHopper - Optimizing high-dimensional hyperparameters

ci_badge Documentation Status pyversion PyPI version downloads

Website | Docs | Paper | Quickstart | Colab Tutorial

PyHopper is a hyperparameter optimizer, made specifically for high-dimensional problems arising in machine learning research and businesses.

pip3 install -U pyhopper

PyHopper is lightweight, rich in features, and requires minimal changes to existing code

import pyhopper

def my_objective(params: dict) -> float:
    model = build_model(params["hidden_size"],...)
    # .... train and evaluate the model
    return val_accuracy

search = pyhopper.Search(
    units   = pyhopper.int(100,500),
    dropout = pyhopper.float(0,0.4,"0.1f"), # 1 decimal digit
    lr      = pyhopper.float(1e-5,1e-2,"0.1g"), # loguniform, 1 significant
    matrix  = pyhopper.float(-1,1,shape=(20,20)), # numpy array
    opt     = pyhopper.choice(["adam","rmsprop","sgd"]),
)
best_params = search.run(my_objective, "maximize", "8h", n_jobs="per-gpu")

Its most important features are

  • 1-line multi-GPU parallelization
  • native NumPy array hyperparameter support
  • automatic runtime scheduling of exploration vs exploitation

Under its hood, PyHopper uses an efficient 2-stage Markov chain Monte Carlo (MCMC) optimization algorithm.

alt

For more info, check out PyHopper's documentation

Copyright ©2018-2022. Mathias Lechner
Copyright ©2022. Massachusetts Institute of Technology
Copyright ©2018-2022. Institute of Science and Technology Austria (IST Austria)
Copyright ©2021-2022. Simple-AI

About

PyHopper is a hyperparameter optimizer, made specifically for high-dimensional problems arising in machine learning research.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages