.. 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.
Metadata
Release files for shgo 1.0.0
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 |
|---|---|---|---|---|
| shgo-1.0.0.tar.gz | 348.3 kB | Without provenance | Details for shgo-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shgo-1.0.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for shgo-1.0.0-py2.py3-none-any.whl |
Total release size: 1.0 MB
Release files / shgo-1.0.0.tar.gz
| Download URL | shgo-1.0.0.tar.gz |
|---|---|
| Size | 348.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c40ed46be204ebeb71287eadcb61c4ee91c4dd73ea0ff5fa300d022f213d76d0
|
|
BLAKE2b-256 checksum How to use checksums |
080798b414fc0e790b58057ed5f3de0ee1c44392247876b6a514af267d035b3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Release files / shgo-1.0.0-py2.py3-none-any.whl
| Download URL | shgo-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 667.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
4daad1f6c781aa20c6efb14bcb51f15a16797cb5e2c47cf9fa2b2c5cee0dbd03
|
|
BLAKE2b-256 checksum How to use checksums |
3450e9703dafc0ec5f5032f13d79fd37cbfe6e4d80fb279431b026b0ca7845d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.9
|
Security for shgo 1.0.0
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.