You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def__init__(self, A, b, x0, proximal, maxit=100, stepsize=1e0, abstol=1e-14, adaptive=True):
613
+
def__init__(self, A, b, proximal, x0, maxit=100, stepsize=1e0, abstol=1e-14, adaptive=True):
614
614
615
615
self.A=A
616
616
self.b=b
@@ -650,8 +650,157 @@ def solve(self):
650
650
x_new=x_new+ ((k-1)/(k+2))*(x_new-x_old)
651
651
652
652
x=x_new.copy()
653
+
654
+
classADMM(object):
655
+
"""Alternating Direction Method of Multipliers for solving regularized linear least squares problems of the form:
656
+
Minimize ||Ax-b||^2 + sum_i f_i(L_i x),
657
+
where the sum ranges from 1 to an arbitrary n. See definition of the parameter `penalty_terms` below for more details about f_i and L_i
658
+
659
+
Reference:
660
+
[1] Boyd et al. "Distributed optimization and statistical learning via the alternating direction method of multipliers."Foundations and Trends® in Machine learning, 2011.
661
+
662
+
663
+
Parameters
664
+
----------
665
+
A : ndarray or callable
666
+
Represents a matrix or a function that performs matrix-vector multiplications.
667
+
When A is a callable, it accepts arguments (x, flag) where:
668
+
- flag=1 indicates multiplication of A with vector x, that is A @ x.
669
+
- flag=2 indicates multiplication of the transpose of A with vector x, that is A.T @ x.
670
+
b : ndarray.
671
+
penalty_terms : List of tuples (callable proximal operator of f_i, linear operator L_i)
672
+
Each callable proximal operator f_i accepts two arguments (x, p) and should return the minimizer of p/2||x-z||^2 + f(x) over z for some f.
673
+
x0 : ndarray. Initial guess.
674
+
penalty_parameter : Trade-off between linear least squares and regularization term in the solver iterates. Denoted as "rho" in [1].
675
+
maxit : The maximum number of iterations.
676
+
adaptive : Whether to adaptively update the penalty_parameter each iteration such that the primal and dual residual norms are of the same order of magnitude. Based on [1], Subsection 3.4.1
677
+
678
+
Example
679
+
-----------
680
+
.. code-block:: python
653
681
682
+
from cuqi.solver import ADMM, ProximalL1, ProjectNonnegative
0 commit comments