Skip to main content

Simplicial homology global optimisation

Project description

.. image:: https://travis-ci.org/Stefan-Endres/shgo.svg?branch=master :target: https://travis-ci.org/Stefan-Endres/shgo .. image:: https://coveralls.io/repos/github/Stefan-Endres/shgo/badge.png?branch=master :target: https://coveralls.io/github/Stefan-Endres/shgo?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:

.. _shgo: https://stefan-endres.github.io/shgo/

::

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:

.. code::

$ pip install shgo

Latest:

.. code::

$ git clone https://github.com/Stefan-Endres/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

.. code:: python

>>> 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 Distribution

shgo-1.0.0.tar.gz (348.3 kB view details)

Uploaded Source

Built Distribution

shgo-1.0.0-py2.py3-none-any.whl (667.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file shgo-1.0.0.tar.gz.

File metadata

  • Download URL: shgo-1.0.0.tar.gz
  • Upload date:
  • Size: 348.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for shgo-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c40ed46be204ebeb71287eadcb61c4ee91c4dd73ea0ff5fa300d022f213d76d0
MD5 b9168fc6d4038f83d6767c61c21ad1fe
BLAKE2b-256 080798b414fc0e790b58057ed5f3de0ee1c44392247876b6a514af267d035b3f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: shgo-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 667.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for shgo-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4daad1f6c781aa20c6efb14bcb51f15a16797cb5e2c47cf9fa2b2c5cee0dbd03
MD5 5d887f84db80d7c1a52e4914d996cac0
BLAKE2b-256 3450e9703dafc0ec5f5032f13d79fd37cbfe6e4d80fb279431b026b0ca7845d0

See more details on using hashes here.

Supported by

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