Package used to find the maximum or minimum of any 2D function using Bayesian optimization
Project description
# Bayesian2D
This package implements Bayesian optimization in Python for any 2D function. It uses Gaussian regression to create a surrogate function and the Maximum Probability of Improvement aquisition function to pick points to evaluate, thus finding the specified extremum of the function in only a few hundred evaluations.
# How to install
The package can simply be installed with ‘pip install Bayesian2D’.
# How to use
The package contains two directories- tools and tests. The tools folder contains all the separate python functions used by the algorithm, with the Bayesian2D function being the main function of the package.
To optimize your function just import ‘from Bayesian2D.tools import Bayesian2D’. The function takes as an input the function you wish to optimize and the bounds in which you wish to search for the extremum (there are a few built in named functions such as ‘Beale’ or ‘Ackley’ with the Rosenbrock function being the default but custom functions can also be inserted). The function also requires you to specify the number of initial points evaluated, the number of optimization cycles run, the number of random points evaluated by the surrogate function each cycle, the exploration constant and whether you want to find the maximum or minimum.
# Testing
Unit tests for all the functions used can be found in the aforementioned tests directory.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Bayesian2D-0.2.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 518c46b5bd424c5d54b0ffcb1023ccca8c5e26696481f6a72cd4665524a59da6 |
|
MD5 | 4b3d08a5941c1a04682f2497133c58b0 |
|
BLAKE2b-256 | 480b2893de2d2c4ffea90481d8706b5fdf9eefd54f68516082dd016e83720982 |