mr2.algorithms.optimizers.admm_l2
- mr2.algorithms.optimizers.admm_l2(g: ProximableFunctionalSeparableSum | ProximableFunctional | Callable[[...], tuple[Tensor, ...]], op: LinearOperator | LinearOperatorMatrix, b: Sequence[Tensor] | Tensor, a: LinearOperator | LinearOperatorMatrix, initial_values: Sequence[Tensor] | Tensor, *, tau: float | Tensor, max_iterations: int = 128, tolerance: float = 0.0, stopping_criterion: Literal['solution', 'residual'] = 'solution', initial_z: Sequence[Tensor] | Tensor | None = None, initial_u: Sequence[Tensor] | Tensor | None = None, cg_max_iterations: int = 128, cg_tolerance: float = 1e-6, callback: Callable[[ADMML2Status], bool | None] | None = None) tuple[Tensor, ...][source]
ADMM for \(\min_x \frac{1}{2}\|Op\,x-b\|_2^2 + g(Ax)\).
This routine targets inverse problems with quadratic data fidelity and proximable regularization in transformed coordinates:
\(\min_x \frac{1}{2}\|Op\,x-b\|_2^2 + g(Ax)\).
Introducing \(z = Ax\), ADMM uses:
\[\begin{split}x_{k+1} = \arg\min_x \frac{1}{2}\|Op\,x-b\|_2^2 + \frac{1}{2\tau}\|Ax-z_k+u_k\|_2^2\\ z_{k+1} = \mathrm{prox}_{\tau g}(Ax_{k+1}+u_k)\\ u_{k+1} = u_k + Ax_{k+1} - z_{k+1}\end{split}\]The x-update is solved with
cgon the normal equations:\[(Op^H Op + \tau^{-1} A^H A)x = Op^H b + \tau^{-1}A^H(z-u).\]- Parameters:
g (
ProximableFunctionalSeparableSum|ProximableFunctional|Callable[...,tuple[Tensor,...]]) – Proximable regularizer. Can be a single functional or aProximableFunctionalSeparableSum, or a split-update callable with signatureg(*values, sigma=tau) -> tuple[Tensor, ...]. The callable replaces the proximal step and must preserve tensor count, shapes, dtypes and devices without modifying inputs in place. It need not define an objective or converge. For a tensor denoiser, uselambda x, **_: (denoiser(x),)and bind its strength explicitly.op (
LinearOperator|LinearOperatorMatrix) – Forward operator \(Op\) in the data term.b (
Sequence[Tensor] |Tensor) – Data tensor(s). Single tensor or tuple of tensors, matching rows ofop.a (
LinearOperator|LinearOperatorMatrix) – Linear operator \(A\) used for splitting in \(g(Ax)\).initial_values (
Sequence[Tensor] |Tensor) – Initial primal variable(s). Single tensor or tuple of tensors.tau (
float|Tensor) – Positive finite real inverse penalty: tau = 1/rho. Complex tensors with zero imaginary part are accepted. Callable updates require a scalar tensor. Functional updates with solution stopping also accept broadcastable tensors. Residual stopping requires a single value.max_iterations (
int, default:128) – Maximum number of ADMM iterations.tolerance (
float, default:0.0) – Nonnegative finite relative stopping tolerance. Zero disables stopping.stopping_criterion (
Literal['solution','residual'], default:'solution') –'solution'checks relative x-change: \(\|x_{k+1}-x_k\|_2 < tolerance \|x_{k+1}\|_2\).'residual'requires both||Ax-z|| <= tolerance * max(||Ax||, ||z||)and||A.H(z-z_previous)/tau|| <= tolerance * ||A.H(u)/tau||. Norms combine all tuple components; zero scales require zero residuals. Residual stopping is recommended for arbitrary split updates, where unchanged x alone need not imply convergence.initial_z (
Sequence[Tensor] |Tensor|None, default:None) – Optional initial split variable(s). IfNone, initialized as \(z_0 = A x_0\).initial_u (
Sequence[Tensor] |Tensor|None, default:None) – Optional initial scaled dual variable(s). IfNone, initialized to zero with shape matchingz.cg_max_iterations (
int, default:128) – Maximum CG iterations used inside each ADMM x-update.cg_tolerance (
float, default:1e-6) – Nonnegative finite absolute residual tolerance used by CG for each x-update.callback (
Callable[[ADMML2Status],bool|None] |None, default:None) – Optional callback called after each iteration withADMML2Status. If it returnsFalse, iterations stop early. With residual stopping, callbacks include the converged iteration. With solution stopping, an early return precedes the callback. Status includes an objective only whengis a functional.
- Returns:
Tuple of tensors representing the final primal variable(s).
- Raises:
ValueError – If the penalty is invalid, operator or functional dimensions are incompatible, or a callable update or its initial split state violates the tensor contract.