Skip to main content

Simplicial homology global optimisation

Project description

https://travis-ci.org/Stefan-Endres/shgo.svg?branch=master https://coveralls.io/repos/github/Stefan-Endres/shgo/badge.png?branch=master

Repository: https://github.com/Stefan-Endres/shgo

Description

Finds the global minimum of a function using simplicial homology global optimisation (shgo). Appropriate for solving general purpose NLP and blackbox optimisation problems to global optimality (low dimensional problems). The general form of an optimisation problem is given by:

minimize f(x) subject to

g_i(x) >= 0,  i = 1,...,m
h_j(x)  = 0,  j = 1,...,p

where x is a vector of one or more variables. f(x) is the objective function R^n -> R, g_i(x) are the inequality constraints. h_j(x) are the equality constrains.

Installation

Stable:

$ pip install shgo

Latest:

$ git clone https://bitbucket.org/upiamcompthermo/shgo
$ cd shgo
$ python setup.py install
$ python setup.py test

Documentation

The project website https://stefan-endres.github.io/shgo/ contains more detailed examples, notes and performance profiles.

Quick example

Consider the problem of minimizing the Rosenbrock function. This function is implemented in rosen in scipy.optimize

>>> from scipy.optimize import rosen
>>> from shgo import shgo
>>> bounds = [(0,2), (0, 2), (0, 2), (0, 2), (0, 2)]
>>> result = shgo(rosen, bounds)
>>> result.x, result.fun
(array([ 1.,  1.,  1.,  1.,  1.]), 2.9203923741900809e-18)

Note that bounds determine the dimensionality of the objective function and is therefore a required input, however you can specify empty bounds using None or objects like numpy.inf which will be converted to large float numbers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shgo-0.4.5-py2.py3-none-any.whl (648.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file shgo-0.4.5-py2.py3-none-any.whl.

File metadata

  • Download URL: shgo-0.4.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 648.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3

File hashes

Hashes for shgo-0.4.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 156d769047c639463767a97cd3660f51523fe1d582975741e87799eda443696b
MD5 61c172569d678569410066748e7b4f66
BLAKE2b-256 18d0f30d4ed7d74d51e72415038472a6d7652154b68889a435018d6fde3a16f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page