Giter Club home page Giter Club logo

hpo_lazygpr's Introduction

Scalable Hyperparameter Optimization with Lazy Gaussian Processes

Original Paper: https://ieeexplore.ieee.org/abstract/document/8950672

Arxiv Paper: https://arxiv.org/abs/2001.05726

This work optimizes a black-box function using 2 variants of Bayesian optimization:

1) Classical Gaussian process

2) A lazy Gaussian process with a positive integer parameter lag,
   When lag==1: the lazy Gaussian process is equivalent to the classical Gaussian process.

How to run the script

The first step would be to run the script 'optimize_function.py' as

python < pythonscript > --seed= < numseeds > --iter= < numiters >

e.g.: python optimize_function.py --seed=1 --iter=200

The function to be optimized should be defined in 'black_box_function' with the bounded space of arguments called 'pbounds'.

For illustration, we have defined a one dimensional negative levy function below:

def black_box_function(x):

w_x = 1 + (x - 1)/4.0
w_b = 1 + (x - 1)/4.0

term1 = (math.sin(math.pi*w_x))**2

term3 = (w_b-1)**2 * (1+(math.sin(2*math.pi*w_b))**2)

y = term1 + term3

return -y

and pbounds: { 'x': (-10, 10)}

A custom black_box_function with range of arguments (pbounds) can also be defined and run using script 'optimize_function.py'.

A boolean flag 'lazy_gpr' is used to distinguish between classical and lazy Gaussian processes. When flag lazy_gpr is False, it denotes bayesian optimization with the classical Gaussian process. and lazy_gpr is True, denotes bayesian optimization with the lazy Gaussian process (with parameter 'lag' that can be set).

Optimization of black-box functions

In the 'experiments' folder, we have optimized the test function: 5-dimensional levy function.

how to run:

cd experiments;

python run_levy5D.py --seed= < numseeds > --iter= < numiters>, e.g. python run_levy5D.py --seed=1 --iter=200

Hyperparameter optimization of neural networks

In the 'experiments' folder, we have optimized the hyperparameters of neural networks. The black box function is the doing the training of the neural networks. The arguments of the black-box function are treated as hyperparameters.

We have optimized the hyperparameters (learning_rate, momentum, weight_decay, keep_prob1, keep_prob2) for LeNet5 with MNIST dataset.

how to run:

cd experiments;

python run_mnist.py --seed= < numseeds > --iter= < numiters >, e.g. python run_mnist.py --seed=1 --iter=1000

We have optimized the hyperparameters (learning_rate, momentum, weight_decay) for ResNet32 with CIFAR10 datset.

how to run:

cd experiments;

python run_cifar10.py --seed= < numseeds > --iter = < numiters >, e.g. python run_cifar10.py --seed=1 --iter=200

The desired accuracy in the neural networks can be modeled by setting the parameter 'eps' in the script, e.g. inside run_cifar10.py: eps=0.21 means reaching an accuracy of 0.79 (1 - 0.21). Once this accuracy is reached, the iteration loop will break.

Authors

Raju Ram ([email protected]) Fraunhofer Institute for Industrial Mathematics, Germany

Sabine Müller ([email protected]) Fraunhofer Institute for Industrial Mathematics, Germany

Please use the Bibtex from paper to cite our work.

hpo_lazygpr's People

Watchers

 avatar paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.