andim/noisyopt

Python library for optimizing noisy functions.
Python TeX
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
 Failed to load latest commit information. doc examples noisyopt .gitignore .travis.yml CONTRIBUTING.md LICENSE README.md codemeta.json paper.bib paper.md requirements.txt setup.cfg setup.py

Noisyopt: A python library for optimizing noisy functions

In some optimization problems a precise evaluation of the function to be optimized is either impossible or exceedingly computationally expensive. This package provides algorithms to optimize a function based on noisy evaluations.

Currently the following algorithms are implemented:

• robust pattern search with adaptive sampling
• simultaneous perturbation stochastic approximation

Both algorithms support bound constraints and do not require to explicitely calculate the gradient of the function.

We do not attempt to find global optima -- look at `scikit-optimize` for Bayesian optimization algorithms aimed at finding global optima to noisy optimization problems. For optimizing functions that are not noisy take a look at `scipy.optimize`.

Installation

Noisyopt is on PyPI so you can install it using `pip install noisyopt`.

Alternatively you can install it from source by obtaining the source code from Github and then running `python setup.py install` in the main directory. If you install from source, you first need to install `numpy` and `scipy` if these packages are not already installed.

Getting started

Find the minimum of the noisy function `obj(x)` with `noisyopt`:

```import numpy as np
from noisyopt import minimizeCompass

def obj(x):
return (x**2).sum() + 0.1*np.random.randn()

bounds = [[-3.0, 3.0], [0.5, 5.0]]
x0 = np.array([-2.0, 2.0])
res = minimizeCompass(obj, bounds=bounds, x0=x0, deltatol=0.1, paired=False)```

Documentation

You can access the documentation online at Read the docs. If you install from source you can generate a local version by running `make html` from the `doc` directory.

Support and contributing

For bug reports and enhancement requests use the Github issue tool, or (even better!) open a pull request with relevant changes. If you have any questions don't hesitate to contact me by email (andimscience@gmail.com) or Twitter (@andimscience).

You can run the testsuite by running `pytest` in the top-level directory.

You are cordially invited to contribute to the further development of noisyopt!