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.
Metadata
Release files for tgo 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tgo-0.1.tar.gz | 710.8 kB | Without provenance | Details for tgo-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tgo-0.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for tgo-0.1-py2.py3-none-any.whl |
Total release size: 1.4 MB
Release files / tgo-0.1.tar.gz
| Download URL | tgo-0.1.tar.gz |
|---|---|
| Size | 710.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ce614eaf86c0d58d866ff84dcd244cc4c1b7625cf1fefe1174d05b932632cdb
|
|
BLAKE2b-256 checksum How to use checksums |
fccdd34007777b0b79513de27e5324c99df44342505e7fa251e05c44300cdc5e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / tgo-0.1-py2.py3-none-any.whl
| Download URL | tgo-0.1-py2.py3-none-any.whl |
|---|---|
| Size | 710.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
1e2c6161db5e633f6498f96e52619cfaca815fbda678032f74af340de080533e
|
|
BLAKE2b-256 checksum How to use checksums |
c257b4124f82aec1171d468519d5f049486404da08cdb9f8df84fd3be9bb0966
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for tgo 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.