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-0.4.8.tar.gz (370.2 kB view details)

Uploaded Source

Built Distributions

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

shgo-0.4.8-py3.9.egg (791.6 kB view details)

Uploaded Egg

shgo-0.4.8-py3-none-any.whl (688.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: shgo-0.4.8.tar.gz
  • Upload date:
  • Size: 370.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for shgo-0.4.8.tar.gz
Algorithm Hash digest
SHA256 96c70c2be3f9f26684ad05d216f62c14294684b27d8f2d5df6c1d7149d16c2aa
MD5 eb48f719f6ba8ae69a0399ac3745f407
BLAKE2b-256 55b94670abadc05f8b597a8e8b87435b233043609f3c7d8b5db36dffd181ac5c

See more details on using hashes here.

File details

Details for the file shgo-0.4.8-py3.9.egg.

File metadata

  • Download URL: shgo-0.4.8-py3.9.egg
  • Upload date:
  • Size: 791.6 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for shgo-0.4.8-py3.9.egg
Algorithm Hash digest
SHA256 ae389d68f928a9a31a7254440bf5dc58098754d8ed4902185f490a04757ebfdc
MD5 3e2fcbaba900e5e65e276450c0269044
BLAKE2b-256 9e5e418af29c5bc368f6e2bd2a5989f36b706f79ea98493b874a80fab562ff01

See more details on using hashes here.

File details

Details for the file shgo-0.4.8-py3-none-any.whl.

File metadata

  • Download URL: shgo-0.4.8-py3-none-any.whl
  • Upload date:
  • Size: 688.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for shgo-0.4.8-py3-none-any.whl
Algorithm Hash digest
SHA256 cb14618ebec2a46b6ed0fc5ee479fba7a868bf15dc92e9436e94afb379e84007
MD5 6e03075053bfeecfcd24c84b8fca096b
BLAKE2b-256 72a820057da6ecf429ffe3ba113e0b70c9926a7eb8bbcd988e63eb3adaa5db11

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