Git Product home page Git Product logo

bayesian-optimization's Introduction

Bayesian optimization with Gaussian processes

This repository contains Python code for Bayesian optimization using Gaussian processes. It contains two directories:

  • python: Contains two python scripts gp.py and plotters.py, that contain the optimization code, and utility functions to plot iterations of the algorithm, respectively.
  • ipython-notebooks: Contains an IPython notebook that uses the Bayesian algorithm to tune the hyperparameters of a support vector machine on a dummy classification task.

The signature of the optimization function is:

bayesian_optimisation(n_iters, sample_loss, bounds, x0=None, n_pre_samples=5,
                      gp_params=None, random_search=False, alpha=1e-5, epsilon=1e-7)

and its docstring is:

bayesian_optimisation

  Uses Gaussian Processes to optimise the loss function `sample_loss`.

  Arguments:
  ----------
      n_iters: integer.
          Number of iterations to run the search algorithm.
      sample_loss: function.
          Function to be optimised.
      bounds: array-like, shape = [n_params, 2].
          Lower and upper bounds on the parameters of the function `sample_loss`.
      x0: array-like, shape = [n_pre_samples, n_params].
          Array of initial points to sample the loss function for. If None, randomly
          samples from the loss function.
      n_pre_samples: integer.
          If x0 is None, samples `n_pre_samples` initial points from the loss function.
      gp_params: dictionary.
          Dictionary of parameters to pass on to the underlying Gaussian Process.
      random_search: integer.
          Flag that indicates whether to perform random search or L-BFGS-B optimisation
          over the acquisition function.
      alpha: double.
          Variance of the error term of the GP.
      epsilon: double.
          Precision tolerance for floats.

bayesian-optimization's People

Contributors

thuijskens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bayesian-optimization's Issues

Code license

Can you please specify under which license has the code been published?

Thanks,
Daniel

A coding error in gp.py

In line 48:
expected_improvement[sigma == 0.0] == 0.0
It should be:
expected_improvement[sigma == 0.0] = 0.0

Funding minima with bayesian_optimization

How effective is the bayesian_optimization for finding constrained minima of functions compared to other methods, such as for example TNC and fmin_L_bfgs from scipy.optimize?
Are there examples of such applications?

Why is `greater_is_better` set to `True`?

In gp.py (when finding the next sample):
next_sample = sample_next_hyperparameter(expected_improvement, model, yp, greater_is_better=True, bounds=bounds, n_restarts=100)
Here greater_is_better is True means that its trying to maximize the loss function instead of minimizing it.

bayesian-optimization

When I run the

rc('text', usetex=False)
plot_iteration(lambdas, xp, yp, first_iter=3, second_param_grid=gammas, optimum=[0.58333333, -2.15789474])

it showed the following issue. Could you please let me know, how can I resolve it.
image

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.