Skip to content

Commit

Permalink
Merge pull request #183 from PyLops/dev
Browse files Browse the repository at this point in the history
Release v0.9.0
  • Loading branch information
mrava87 authored Aug 16, 2024
2 parents 8a4fc96 + 8efa282 commit 1e9e91b
Show file tree
Hide file tree
Showing 20 changed files with 809 additions and 78 deletions.
2 changes: 0 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ build:
os: ubuntu-20.04
tools:
python: "3.9"
apt_packages:
- libopenblas-dev

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Changelog
=========

# 0.9.0

* Added :py:class:`pyproximal.optimization.palm.iPALM` solver
* Added :py:func:`pyproximal.optimization.palm._backtracking` method to be used when `gammaf=None` and/or `gammag=None`
* Added :py:func:`pyproximal.utils.gradtest.gradtest_proximal` and :py:func:`pyproximal.utils.gradtest.gradtest_bilinear` methods
* Added `tol` to :py:class:`pyproximal.optimization.primal.ProximalPoint` and
:py:class:`pyproximal.optimization.primal.ProximalGradient` solvers
* Modified :py:class:`pyproximal.ProxOperator.precomposition` to allow `b` being also a vector


# 0.8.0

* Added ``pyproximal.projection.L01BallProj`` and ``pyproximal.proximal.L01Ball`` operators
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
![PyProximal](https://github.com/PyLops/pyproximal/blob/dev/docs/source/_static/pyproximal_b.png)

[![PyPI version](https://badge.fury.io/py/pyproximal.svg)](https://badge.fury.io/py/pyproximal)
[![Build Status](https://travis-ci.com/PyLops/pyproximal.svg?branch=main)](https://travis-ci.com/PyLops/pyproximal)
[![AzureDevOps Status](https://dev.azure.com/matteoravasi/PyLops/_apis/build/status%2FPyLops.pyproximal?branchName=refs%2Fpull%2F129%2Fmerge)](https://dev.azure.com/matteoravasi/PyLops/_build/latest?definitionId=10&branchName=refs%2Fpull%2F129%2Fmerge)
[![AzureDevOps Status](https://dev.azure.com/matteoravasi/PyLops/_apis/build/status%2FPyLops.pyproximal?branchName=refs%2Fpull%2F180%2Fmerge)](https://dev.azure.com/matteoravasi/PyLops/_build/latest?definitionId=10&branchName=refs%2Fpull%2F180%2Fmerge)
![GithubAction Status](https://github.com/PyLops/pyproximal/workflows/PyProx/badge.svg)
[![Documentation Status](https://readthedocs.org/projects/pyproximal/badge/?version=latest)](https://pyproximal.readthedocs.io/en/latest/?badge=latest)
[![OS-support](https://img.shields.io/badge/OS-linux,osx-850A8B.svg)](https://github.com/PyLops/pyproximal)
[![Slack Status](https://img.shields.io/badge/chat-slack-green.svg)](https://pylops.slack.com)

[![DOI](https://joss.theoj.org/papers/10.21105/joss.06326/status.svg)](https://doi.org/10.21105/joss.06326)


:vertical_traffic_light: :vertical_traffic_light: This library is under early development.
Expand Down Expand Up @@ -184,9 +183,17 @@ make docupdate
Note that if a new example or tutorial is created (and if any change is made to a previously available example or tutorial)
you are required to rebuild the entire documentation before your changes will be visible.

## Citing
When using PyProximal in scientific publications, please cite the following paper:

- Ravasi M, Örnhag M. V., Luiken N., Leblanc O. and Uruñuela E., 2024, *<b>PyProximal - scalable convex optimization in Python</b>*,
Journal of Open Source Software, 9(95), 6326. doi: 10.21105/joss.06326 [(link)](https://joss.theoj.org/papers/10.21105/joss.06326)



## Contributors
* Matteo Ravasi, mrava87
* Nick Luiken, NickLuiken
* Eneko Uruñuela, eurunuela
* Marcus Valtonen Örnhag, marcusvaltonen
* Olivier Leblanc, olivierleblanc
13 changes: 13 additions & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ Other operators
BilinearOperator
LowRankFactorizedMatrix

Utility functions
-----------------

.. currentmodule:: pyproximal.utils.gradtest

.. autosummary::
:toctree: generated/

gradtest_proximal
gradtest_bilinear



Solvers
-------
Expand Down Expand Up @@ -158,6 +170,7 @@ Primal
:toctree: generated/

PALM
iPALM

.. currentmodule:: pyproximal.optimization.pnp

Expand Down
12 changes: 12 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
Changelog
=========

Version 0.9.0
--------------
*Released on: 16/08/2024*

* Added :py:class:`pyproximal.optimization.palm.iPALM` solver
* Added :py:func:`pyproximal.optimization.palm._backtracking` method to be used when `gammaf=None` and/or `gammag=None`
* Added :py:func:`pyproximal.utils.gradtest.gradtest_proximal` and :py:func:`pyproximal.utils.gradtest.gradtest_bilinear` methods
* Added `tol` to :py:class:`pyproximal.optimization.primal.ProximalPoint` and
:py:class:`pyproximal.optimization.primal.ProximalGradient` solvers
* Modified :py:class:`pyproximal.ProxOperator.precomposition` to allow `b` being also a vector


Version 0.8.0
--------------
*Released on: 11/03/2024*
Expand Down
3 changes: 2 additions & 1 deletion docs/source/credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ Contributors
* `Matteo Ravasi <https://github.com/mrava87>`_, mrava87
* `Nick Luiken <https://github.com/NickLuiken>`_, NickLuiken
* `Eneko Uruñuela <https://github.com/eurunuela>`_, eurunuela
* `Marcus Valtonen Örnhag <https://github.com/marcusvaltonen>`_, marcusvaltonen
* `Marcus Valtonen Örnhag <https://github.com/marcusvaltonen>`_, marcusvaltonen
* `Olivier Leblanc <https://github.com/olivierleblanc>`_, olivierleblanc
27 changes: 27 additions & 0 deletions environment-dev-arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: pyproximal
channels:
- defaults
- conda-forge
- numba
dependencies:
- python>=3.8.12
- numpy>=1.15.0, <2.0.0
- scipy>=1.8.0
- pylops>=2.0.0
- scikit-image
- matplotlib
- ipython
- pytest
- Sphinx
- numpydoc
- numba
- icc_rt
- pip:
- bm3d
- pytest-runner
- setuptools_scm
- pydata-sphinx-theme
- sphinx-gallery
- nbsphinx
- image
- sphinxemoji
5 changes: 3 additions & 2 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ channels:
- numba
dependencies:
- python>=3.8.12
- numpy>=1.15.0
- numpy>=1.15.0, <2.0.0
- scipy>=1.8.0
- pylops>=2.0.0
- scikit-image
Expand All @@ -17,7 +17,8 @@ dependencies:
- numba
- icc_rt
- pip:
- bm3d
- bm4d<4.2.4 # temporary fix as GLIBC_2.32 not found by readthedocs
- bm3d<4.0.2 # temporary fix as GLIBC_2.32 not found by readthedocs
- pytest-runner
- setuptools_scm
- pydata-sphinx-theme
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ channels:
- defaults
dependencies:
- python>=3.8.12
- numpy>=1.15.0
- numpy>=1.15.0, <2.0.0
- scipy>=1.8.0
- pylops>=2.0.0
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Mathematics",
]
dependencies = [
"numpy >= 1.15.0",
"numpy >= 1.15.0, <2.0.0",
"scipy >= 1.8.0",
"pylops >= 2.0.0",
]
Expand Down
25 changes: 13 additions & 12 deletions pyproximal/ProxOperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,16 @@ def _proxdual_moreau(self, x, tau, **kwargs):
def prox(self, x, tau, **kwargs):
"""Proximal operator applied to a vector
The proximal operator can always be computed given its dual
The proximal operator can always be computed given its dual
proximal operator using the Moreau decomposition as defined in
:func:`pyprox.moreau`. For this reason we can easily create a common
:func:`pyproximal.moreau`. For this reason we can easily create a common
method for all proximal operators that can be evaluated provided the
dual proximal is implemented.
However, direct implementations are generally available. This can
be done by simply implementing ``prox`` for a specific proximal
operator, which will overwrite the general method.
Parameters
----------
x : :obj:`np.ndarray`
Expand All @@ -100,9 +99,9 @@ def proxdual(self, x, tau, **kwargs):
The dual of a proximal operator can always be computed given its
proximal operator using the Moreau decomposition as defined in
:func:`pyprox.moreau`. For this reason we can easily create a common
:func:`pyproximal.moreau`. For this reason we can easily create a common
method for all dual proximal operators that can be evaluated provided
he proximal is implemented.
the proximal is implemented.
However, since the dual of a proximal operator of a function is
equivalent to the proximal operator of the conjugate function, smarter
Expand Down Expand Up @@ -163,7 +162,7 @@ def affine_addition(self, v):
if isinstance(v, np.ndarray):
return _SumOperator(self, v)
else:
return NotImplemented
raise NotImplementedError('v must be of type numpy.ndarray')

def postcomposition(self, sigma):
r"""Postcomposition
Expand Down Expand Up @@ -191,7 +190,7 @@ def postcomposition(self, sigma):
if isinstance(sigma, float):
return _PostcompositionOperator(self, sigma)
else:
return NotImplemented
raise NotImplementedError('sigma must be of type float')

def precomposition(self, a, b):
r"""Precomposition
Expand All @@ -203,8 +202,8 @@ def precomposition(self, a, b):
----------
a : :obj:`float`
Multiplicative scalar
b : :obj:`float`
Additive Scalar
b : :obj:`float` or obj:`np.ndarray`
Additive scalar (or vector)
Notes
-----
Expand All @@ -217,10 +216,12 @@ def precomposition(self, a, b):
prox_{a^2 \tau f} (a \mathbf{x} + b) - b)
"""
if isinstance(a, float) and isinstance(b, float):
if isinstance(a, float) and isinstance(b, (float, np.ndarray)):
return _PrecompositionOperator(self, a, b)
else:
return NotImplemented
raise NotImplementedError('a must be of type float and b '
'must be of type float or '
'numpy.ndarray')

def chain(self, g):
r"""Chain
Expand Down Expand Up @@ -347,7 +348,7 @@ def __init__(self, f, a, b):
# raise ValueError('First input must be a ProxOperator')
if not isinstance(a, float):
raise ValueError('Second input must be a float')
if not isinstance(b, float):
if not isinstance(b, (float, np.ndarray)):
raise ValueError('Second input must be a float')
self.f, self.a, self.b = f, a, b
super().__init__(None, True if f.grad else False)
Expand Down
1 change: 1 addition & 0 deletions pyproximal/optimization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
SR3 Sparse Relaxed Regularized algorithm
PALM Proximal Alternating Linearized Minimization
iPALM Inertial Proximal Alternating Linearized Minimization
Finally this subpackage contains also a solver for image segmentation based
on a special use of the Primal-Dual algorithm:
Expand Down
Loading

0 comments on commit 1e9e91b

Please sign in to comment.