Skip to content

Commit 7a2afe7

Browse files
authored
Merge branch 'dev' into dev
2 parents 7f6a2f8 + 97d24fd commit 7a2afe7

File tree

12 files changed

+382
-14
lines changed

12 files changed

+382
-14
lines changed

CHANGELOG.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1+
# 0.5.0
2+
3+
:vertical_traffic_light: :vertical_traffic_light: This is the latest release supporting PyLops v1.
4+
:vertical_traffic_light: :vertical_traffic_light:
5+
6+
* Added ``pyproximal.proximal.Log1`` operator
7+
* Allow ``radius`` parameter of ``pyproximal.optimization.primal.L0`` to be a function
8+
* Allow ``tau`` parameter of ``pyproximal.optimization.primal.HQS`` to be a vector
9+
and change over iterations
10+
* Added ``z0`` to ``pyproximal.optimization.primal.HQS``
11+
* Added ``factorize`` option to ``densesolver`` of ``pyproximal.proximal.L2``
12+
113
# 0.4.0
214
* Added ``pyproximal.optimization.primal.ADMML2``,
3-
``pyproximal.optimization.primal.HQS``,
15+
`pyproximal.optimization.primal.HQS`,
416
and ``pyproximal.optimization.pnp.PlugAndPlay`` solvers
517
* Added ``pyproximal.proximal.ETP``, ``pyproximal.proximal.Geman``,
6-
``pyproximal.proximal.L0``, ``pyproximal.proximal.Log``,
18+
``pyproximal.proximal.L0`, ``pyproximal.proximal.Log``,
719
``pyproximal.proximal.QuadraticEnvelopeCard``, ``pyproximal.proximal.SCAD``
820
operators.
9-
* Allow `tau` parameter of proximal operators to be a vector to handle problems with
21+
* Allow ``tau`` parameter of proximal operators to be a vector to handle problems with
1022
multiple right-hand sides.
1123

1224
# 0.3.0

docs/source/changelog.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
33
Changelog
44
=========
55

6+
Version 0.5.0
7+
--------------
8+
*Released on: 20/08/2022*
9+
10+
|:vertical_traffic_light:| |:vertical_traffic_light:| This is the latest release supporting PyLops v1.
11+
|:vertical_traffic_light:| |:vertical_traffic_light:|
12+
13+
* Added :py:class:`pyproximal.proximal.Log1` operator
14+
* Allow ``radius`` parameter of :py:class:`pyproximal.optimization.primal.L0` to be a function
15+
* Allow ``tau`` parameter of :py:class:`pyproximal.optimization.primal.HQS` to be a vector
16+
and change over iterations
17+
* Added ``z0`` to :py:class:`pyproximal.optimization.primal.HQS`
18+
* Added ``factorize`` option to ``densesolver`` of :py:class:`pyproximal.proximal.L2`
19+
620
Version 0.4.0
721
--------------
822
*Released on: 05/06/2022*
@@ -14,7 +28,7 @@ Version 0.4.0
1428
:py:class:`pyproximal.proximal.L0`, :py:class:`pyproximal.proximal.Log`,
1529
:py:class:`pyproximal.proximal.QuadraticEnvelopeCard`, :py:class:`pyproximal.proximal.SCAD`
1630
operators.
17-
* Allow `tau` parameter of proximal operators to be a vector to handle problems with
31+
* Allow ``tau`` parameter of proximal operators to be a vector to handle problems with
1832
multiple right-hand sides.
1933

2034
Version 0.3.0

docs/source/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
'numpydoc',
2424
'nbsphinx',
2525
'sphinx_gallery.gen_gallery',
26-
#'sphinx.ext.napoleon',
26+
'sphinxemoji.sphinxemoji',
2727
]
2828

2929
# intersphinx configuration
@@ -66,7 +66,9 @@
6666
# Modules for which function level galleries are created.
6767
'doc_module': 'pyproximal',
6868
# Insert links to documentation of objects in the examples
69-
'reference_url': {'pyproximal': None}
69+
'reference_url': {'pyproximal': None},
70+
# Allow animations
71+
'matplotlib_animations': True,
7072
}
7173

7274
# Always show the source code that generates a plot

environment-dev.yml

100755100644
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ dependencies:
2323
- sphinx-rtd-theme
2424
- sphinx-gallery
2525
- nbsphinx
26-
- image
26+
- image
27+
- sphinxemoji

environment.yml

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ dependencies:
55
- python>=3.8.12
66
- numpy>=1.15.0
77
- scipy>=1.8.0
8-
- pylops>=2.0.0
8+
- pylops>=2.0.0

pyproximal/optimization/primal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def ProximalGradient(proxf, proxg, x0, tau=None, beta=0.5,
183183
\nabla f(\mathbf{y})^T (\mathbf{x} - \mathbf{y}) +
184184
1/(2\tau)||\mathbf{x} - \mathbf{y}||_2^2`.
185185
186-
Different accellerations are provided:
186+
Different accelerations are provided:
187187
188188
- ``acceleration=None``: :math:`\omega^k = 0`;
189189
- `acceleration=vandenberghe`` [1]_: :math:`\omega^k = k / (k + 3)` for `
@@ -211,10 +211,10 @@ def ProximalGradient(proxf, proxg, x0, tau=None, beta=0.5,
211211
'---------------------------------------------------------\n'
212212
'Proximal operator (f): %s\n'
213213
'Proximal operator (g): %s\n'
214-
'tau = %10e\tbeta=%10e\n'
214+
'tau = %s\tbeta=%10e\n'
215215
'epsg = %s\tniter = %d\t'
216216
'niterback = %d\n' % (type(proxf), type(proxg),
217-
0 if tau is None else tau, beta,
217+
'Adaptive' if tau is None else str(tau), beta,
218218
epsg_print, niter, niterback))
219219
head = ' Itn x[0] f g J=f+eps*g'
220220
print(head)

pyproximal/optimization/segmentation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def Segment(y, cl, sigma, alpha, clsigmas=None, z=None, niter=10, x0=None,
6868
:math:`\mathbf{\sigma}=[\sigma_1, ..., \sigma_{N_{cl}}]^T` are vectors
6969
representing the optimal mean and standard deviations for each class.
7070
71-
.. [1] Chambolle, and A., Pock, "A first-order primal-dual algorithm for
71+
.. [1] Chambolle, and A., Pock, "A first-order primal-dual algorithm for
7272
convex problems with applications to imaging", Journal of Mathematical
7373
Imaging and Vision, 40, 8pp. 120–145. 2011.
7474

pyproximal/utils/bilinear.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class BilinearOperator():
1111
:math:`\nabla_x H`
1212
- ``grady``: a method evaluating the gradient over :math:`\mathbf{y}`:
1313
:math:`\nabla_y H`
14+
- ``grad``: a method returning the stacked gradient vector over
15+
:math:`\mathbf{x},\mathbf{y}`: :math:`[\nabla_x H`, [\nabla_y H]`
1416
- ``lx``: Lipschitz constant of :math:`\nabla_x H`
1517
- ``ly``: Lipschitz constant of :math:`\nabla_y H`
1618
@@ -33,6 +35,9 @@ def gradx(self, x):
3335
def grady(self, y):
3436
pass
3537

38+
def grad(self, y):
39+
pass
40+
3641
def lx(self, x):
3742
pass
3843

@@ -100,7 +105,9 @@ def __init__(self, X, Y, d, Op=None):
100105
self.shapex = (self.n * self.m, self.n * self.k)
101106
self.shapey = (self.n * self.m, self.m * self.k)
102107

103-
def __call__(self, x, y):
108+
def __call__(self, x, y=None):
109+
if y is None:
110+
x, y = x[:self.n * self.k], x[self.n * self.k:]
104111
xold = self.x.copy()
105112
self.updatex(x)
106113
res = self.d - self._matvecy(y)
@@ -159,3 +166,11 @@ def grady(self, y):
159166
r = r.reshape(self.n, self.m)
160167
g = -self.x.reshape(self.n, self.k).T @ r
161168
return g.ravel()
169+
170+
def grad(self, x):
171+
self.updatex(x[:self.n * self.k])
172+
self.updatey(x[self.n * self.k:])
173+
gx = self.gradx(x[:self.n * self.k])
174+
gy = self.grady(x[self.n * self.k:])
175+
g = np.hstack([gx, gy])
176+
return g

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ sphinx-rtd-theme
1515
sphinx-gallery
1616
numpydoc
1717
nbsphinx
18-
image
18+
image
19+
sphinxemoji

setup.py

100755100644
File mode changed.

0 commit comments

Comments
 (0)