Skip to content

Commit 04524d0

Browse files
authored
Merge pull request #247 from tttamaki/dev_DRS_fix
change behavior of DouglasRachfordSplitting
2 parents 8597806 + 4a45d17 commit 04524d0

File tree

2 files changed

+24
-15
lines changed

2 files changed

+24
-15
lines changed

pyproximal/optimization/primal.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,23 +1740,32 @@ def DouglasRachfordSplitting(
17401740
Notes
17411741
-----
17421742
The Douglas-Rachford Splitting algorithm can be expressed by the following
1743-
recursion [1]_, [2]_:
1743+
recursion [1]_, [2]_, [3]_, [4]_:
17441744
17451745
.. math::
17461746
1747-
\mathbf{y}^{k} &= \prox_{\tau g}(\mathbf{x}^k) \\
1748-
\mathbf{x}^{k+1} &= \mathbf{x}^{k} +
1749-
\eta (\prox_{\tau f}(2 \mathbf{y}^{k} - \mathbf{x}^{k})
1750-
- \mathbf{y}^{k})
1747+
\mathbf{x}^{k} &= \prox_{\tau g}(\mathbf{y}^k) \\
1748+
\mathbf{y}^{k+1} &= \mathbf{y}^{k} +
1749+
\eta (\prox_{\tau f}(2 \mathbf{x}^{k} - \mathbf{y}^{k})
1750+
- \mathbf{x}^{k})
17511751
17521752
.. [1] Patrick L. Combettes and Jean-Christophe Pesquet. 2011. Proximal
17531753
Splitting Methods in Signal Processing. In Fixed-Point Algorithms for
1754-
Inverse Problems in Science and Engineering, Springer, 185-212.
1754+
Inverse Problems in Science and Engineering, Springer, pp. 185-212.
1755+
Algorithm 10.15.
17551756
https://doi.org/10.1007/978-1-4419-9569-8_10
17561757
.. [2] Scott B. Lindstrom and Brailey Sims. 2021. Survey: Sixty Years of
17571758
Douglas-Rachford. Journal of the Australian Mathematical Society, 110,
1758-
3, 333-370. https://doi.org/10.1017/S1446788719000570
1759+
3, 333-370. Eq.(15). https://doi.org/10.1017/S1446788719000570
17591760
https://arxiv.org/abs/1809.07181
1761+
.. [3] Ryu, E.K., Yin, W., 2022. Large-Scale Convex Optimization: Algorithms
1762+
& Analyses via Monotone Operators. Cambridge University Press,
1763+
Cambridge. Eq.(2.18). https://doi.org/10.1017/9781009160865
1764+
https://large-scale-book.mathopt.com/
1765+
.. [4] Combettes, P.L., Pesquet, J.-C., 2008. A proximal decomposition
1766+
method for solving convex variational inverse problems. Inverse Problems
1767+
24, 065014. Proposition 3.2. https://doi.org/10.1088/0266-5611/24/6/065014
1768+
https://arxiv.org/abs/0807.2617
17601769
17611770
"""
17621771
if show:
@@ -1771,14 +1780,14 @@ def DouglasRachfordSplitting(
17711780
head = " Itn x[0] f g J = f + g"
17721781
print(head)
17731782

1774-
x = x0.copy()
1783+
y = x0.copy()
17751784
for iiter in range(niter):
17761785
if gfirst:
1777-
y = proxg.prox(x, tau)
1778-
x = x + eta * (proxf.prox(2 * y - x, tau) - y)
1786+
x = proxg.prox(y, tau)
1787+
y = y + eta * (proxf.prox(2 * x - y, tau) - x)
17791788
else:
1780-
y = proxf.prox(x, tau)
1781-
x = x + eta * (proxg.prox(2 * y - x, tau) - y)
1789+
x = proxf.prox(y, tau)
1790+
y = y + eta * (proxg.prox(2 * x - y, tau) - x)
17821791

17831792
# run callback
17841793
if callback is not None:

pytests/test_solver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,19 +210,19 @@ def test_ADMM_DRS(par):
210210
# ADMM
211211
l2 = L2(Op=Rop, b=y, niter=10, warm=True)
212212
l1 = L1(sigma=5e-1)
213-
xadmm = ADMM(l2, l1, x0=np.zeros(m), tau=tau, niter=100, show=True)
213+
xadmm, zadmm = ADMM(l2, l1, x0=np.zeros(m), tau=tau, niter=100, show=True)
214214

215215
# DRS with g first
216216
l2 = L2(Op=Rop, b=y, niter=10, warm=True)
217217
l1 = L1(sigma=5e-1)
218-
xdrs_g = DouglasRachfordSplitting(
218+
xdrs_g, ydrs_g = DouglasRachfordSplitting(
219219
l2, l1, x0=np.zeros(m), tau=tau, niter=100, show=True, gfirst=True
220220
)
221221

222222
# DRS with f first
223223
l2 = L2(Op=Rop, b=y, niter=10, warm=True)
224224
l1 = L1(sigma=5e-1)
225-
xdrs_f = DouglasRachfordSplitting(
225+
xdrs_f, ydrs_f = DouglasRachfordSplitting(
226226
l2, l1, x0=np.zeros(m), tau=tau, niter=100, show=True, gfirst=False
227227
)
228228

0 commit comments

Comments
 (0)