PyUNLocBoX is a convex optimization toolbox using proximal splitting methods implemented in Python. It is a free software distributed under the BSD license and is a port of the Matlab UNLocBoX toolbox.


  • Solvers
    • Forward-backward splitting algorithm
    • Douglas-Rachford splitting algorithm
    • Monotone+Lipschitz Forward-Backward-Forward primal-dual algorithm
    • Projection-based primal-dual algorithm
  • Proximal operators
    • L1-norm
    • L2-norm
    • TV-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.

>>> import pyunlocbox
>>> f1 = pyunlocbox.functions.norm_l2(y=[4, 5, 6, 7])
>>> f2 = pyunlocbox.functions.dummy()
>>> solver = pyunlocbox.solvers.forward_backward()
>>> ret = pyunlocbox.solvers.solve([f1, f2], [0., 0, 0, 0], solver, atol=1e-5)
Solution found after 10 iterations:
    objective function f(sol) = 7.460428e-09
    stopping criterion: ATOL
>>> ret['sol']
array([ 3.99996922,  4.99996153,  5.99995383,  6.99994614])


PyUnLocBox is continuously tested on Python 2.7, 3.3, 3.4 and 3.5.

System-wide installation:

$ pip install pyunlocbox

Installation in an isolated virtual environment:

$ mkvirtualenv --system-site-packages pyunlocbox
$ pip install pyunlocbox

You need virtualenvwrapper to run this command. The --system-site-packages option could be useful if you want to use a shared system installation of numpy and matplotlib. Their building and installation require quite some dependencies.

Another way is to manually download from PyPI, unpack the package and install with:

$ python setup.py install

Execute the project test suite once to make sure you have a working install:

$ python setup.py test


PyUNLocBoX was started in 2014 as an academic project for research purpose at the LTS2 laboratory from EPFL (https://lts2.epfl.ch).

Development lead :

Contributors :