pyproximal.optimization.primal.HQS#
- pyproximal.optimization.primal.HQS(proxf: ProxOperator, proxg: ProxOperator, x0: ndarray[tuple[Any, ...], dtype[_ScalarT]], tau: Union[float, ndarray[tuple[Any, ...], dtype[_ScalarT]]], niter: int = 10, z0: Optional[ndarray[tuple[Any, ...], dtype[_ScalarT]]] = None, gfirst: bool = True, callback: Optional[Callable[[...], None]] = None, callbackz: bool = False, show: bool = False) Tuple[ndarray[tuple[Any, ...], dtype[_ScalarT]], ndarray[tuple[Any, ...], dtype[_ScalarT]]][source]#
Half Quadratic splitting
Solves the following minimization problem using Half Quadratic splitting algorithm:
\[\begin{split}\mathbf{x},\mathbf{z} = \argmin_{\mathbf{x},\mathbf{z}} f(\mathbf{x}) + g(\mathbf{z}) \\ s.t. \; \mathbf{x}=\mathbf{z}\end{split}\]where \(f(\mathbf{x})\) and \(g(\mathbf{z})\) are any convex function that has a known proximal operator.
- Parameters
- proxf
pyproximal.ProxOperator Proximal operator of f function
- proxg
pyproximal.ProxOperator Proximal operator of g function
- x0
numpy.ndarray Initial vector (not required when
gfirst=False, can passNone)- tau
floatornumpy.ndarray Positive scalar weight, which should satisfy the following condition to guarantees convergence: \(\tau \in (0, 1/L]\) where
Lis the Lipschitz constant of \(\nabla f\). Finally note that \(\tau\) can be chosen to be a vector of sizenitersuch that different \(\tau\) is used at different iterations (i.e., continuation strategy)- niter
int Number of iterations of iterative scheme
- z0
numpy.ndarray, optional Initial z vector (not required when
gfirst=True)- gfirst
bool, optional Apply Proximal of operator
gfirst (True) or Proximal of operatorffirst (False)- callback
callable, optional Function with signature (
callback(x)) to call after each iteration wherexis the current model vector- callbackz
bool, optional Modify callback signature to (
callback(x, z)) whencallbackz=True- show
bool, optional Display iterations log
- proxf
- Returns
- x
numpy.ndarray Inverted model
- z
numpy.ndarray Inverted second model
- x
- Raises
- ValueError
If both
x0andz0are set toNone
Notes
The HQS algorithm can be expressed by the following recursion [1]:
\[\begin{split}\mathbf{z}^{k+1} = \prox_{\tau g}(\mathbf{x}^{k}) \\ \mathbf{x}^{k+1} = \prox_{\tau f}(\mathbf{z}^{k+1})\end{split}\]for
gfirst=False, or\[\begin{split}\mathbf{x}^{k+1} = \prox_{\tau f}(\mathbf{z}^{k}) \\ \mathbf{z}^{k+1} = \prox_{\tau g}(\mathbf{x}^{k+1})\end{split}\]for
gfirst=False. Note thatxandzconverge to each other, however if iterations are stopped too earlyxis guaranteed to belong to the domain offwhilezis guaranteed to belong to the domain ofg. Depending on the problem either of the two may be the best solution.- 1
D., Geman, and C., Yang, “Nonlinear image recovery with halfquadratic regularization”, IEEE Transactions on Image Processing, 4, 7, pp. 932-946, 1995.