Skip to main content

Topographical global optimisation

Project description

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

Description

Finds the global minimum of a function using topographical global optimisation (tgo). 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 tgo

Latest:

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

Documentation

The docstrings and project website https://stefan-endres.github.io/tgo/ 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 tgo import tgo
>>> 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


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

tgo-0.1.tar.gz (710.8 kB view details)

Uploaded Source

Built Distribution

tgo-0.1-py2.py3-none-any.whl (710.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file tgo-0.1.tar.gz.

File metadata

  • Download URL: tgo-0.1.tar.gz
  • Upload date:
  • Size: 710.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tgo-0.1.tar.gz
Algorithm Hash digest
SHA256 1ce614eaf86c0d58d866ff84dcd244cc4c1b7625cf1fefe1174d05b932632cdb
MD5 8a805925fd59eaa652bc7bb5fb40073d
BLAKE2b-256 fccdd34007777b0b79513de27e5324c99df44342505e7fa251e05c44300cdc5e

See more details on using hashes here.

File details

Details for the file tgo-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for tgo-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1e2c6161db5e633f6498f96e52619cfaca815fbda678032f74af340de080533e
MD5 cca531f2c763017798152a10bb93b678
BLAKE2b-256 c257b4124f82aec1171d468519d5f049486404da08cdb9f8df84fd3be9bb0966

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