Skip to main content

Convex Optimization in Python using Proximal Splitting

Project description

doc pypi license pyversions

binder travis coveralls github

The PyUNLocBoX is a Python package which uses proximal splitting methods to solve non-differentiable convex optimization problems. It is a free software, distributed under the BSD license, and available on PyPI. The documentation is available on Read the Docs and development takes place on GitHub. (A Matlab counterpart exists.)

The package is designed to be easy to use while allowing any advanced tasks. It is not meant to be a black-box optimization tool. You’ll have to carefully design your solver. In exchange you’ll get full control of what the package does for you, without the pain of rewriting the proximity operators and the solvers and with the added benefit of tested algorithms. With this package, you can focus on your problem and the best way to solve it rather that the details of the algorithms. It comes with the following solvers:

  • Gradient descent

  • Forward-backward splitting algorithm (FISTA, ISTA)

  • Douglas-Rachford splitting algorithm

  • Generalized forward-backward

  • Monotone+Lipschitz forward-backward-forward primal-dual algorithm

  • Projection-based primal-dual algorithm

Moreover, the following acceleration schemes are included:

  • FISTA acceleration scheme

  • Backtracking based on a quadratic approximation of the objective

  • Regularized nonlinear acceleration (RNA)

To compose your objective, you can either define your custom functions (which should implement an evaluation method and a gradient or proximity method) or use one of the followings:

  • L1-norm

  • L2-norm

  • TV-norm

  • Nuclear-norm

  • Projection on the L2-ball

Following is a typical usage example who solves an optimization problem composed by the sum of two convex functions. The functions and solver objects are first instantiated with the desired parameters. The problem is then solved by a call to the solving function.

>>> from pyunlocbox import functions, solvers
>>> f1 = functions.norm_l2(y=[4, 5, 6, 7])
>>> f2 = functions.dummy()
>>> solver = solvers.forward_backward()
>>> ret = solvers.solve([f1, f2], [0., 0, 0, 0], solver, atol=1e-5)
Solution found after 9 iterations:
    objective function f(sol) = 6.714385e-08
    stopping criterion: ATOL
>>> ret['sol']
array([ 3.99990766,  4.99988458,  5.99986149,  6.99983841])

You can try it online, look at the tutorials to learn how to use it, or look at the reference guide for an exhaustive documentation of the API. Enjoy the package!

Installation

The PyUNLocBoX is available on PyPI:

$ pip install pyunlocbox

Contributing

See the guidelines for contributing in CONTRIBUTING.rst.

Acknowledgments

The PyUNLocBoX was started in 2014 as an academic open-source project for research purpose at the EPFL LTS2 laboratory.

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

pyunlocbox-0.5.2.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

pyunlocbox-0.5.2-py2.py3-none-any.whl (41.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pyunlocbox-0.5.2.tar.gz.

File metadata

  • Download URL: pyunlocbox-0.5.2.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyunlocbox-0.5.2.tar.gz
Algorithm Hash digest
SHA256 1b5da78030fde06961acfac1ad2652daed473f5c7cc2c0d9b7845660ef46b4af
MD5 8d957ea2d3000c8ea5bc812747241f0f
BLAKE2b-256 7ce48d96c6bd7c766c767da9be91badb9263fd2cf4e4a5fe52f7d19ec7579969

See more details on using hashes here.

File details

Details for the file pyunlocbox-0.5.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyunlocbox-0.5.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 94a4622d73ff80f2456395234a5c0979bb2a7dbf11adae1ab0c38449b95ae242
MD5 901e1e8db3b3523b7921552a6cc99cb7
BLAKE2b-256 2820aa136e2a881b56742f7fadc707c99accf92133dd2d697e4f4fb77e316059

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