lsqr#
- mrinufft.extras.lsqr(operator: FourierOperatorBase, kspace_data: NDArray, damp: float = 0.0, atol: float = 1e-06, btol: float = 1e-06, conlim: float = 100000000.0, max_iter: int = 100, x0: NDArray | None = None, x_init: NDArray | None = None, callback: Callable | None = None, progressbar: bool | tqdm = True)[source]#
Solve a regularized linear least-squares problem with the LSQR algorithm [1].
This implementation follows the numerically stable formulation described in [2] and is adapted from the SciPy implementation [3].
Solves problems of the form
\[\arg\min \|A x - b\|_2^2 + \gamma^2 \|x - x0\|_2^2\]Stop iterating if:
numerical convergence is reached: \(\|Ax-b\| <= atol \|A\| * \|x\| + btol * \|b\|\)
estimation of the conditioning of the problem diverge:
cond(A)>=conlimMaximum number of iteration reached.
- Parameters:
$base_params
atol (float, optional) – Stopping tolerance on the absolute error. Default is 1e-6.
btol (float, optional) – Stopping tolerance on the relative error. Default is 1e-6.
conlim (float, optional) – Limit on condition number. Iteration stops if condition exceeds this value. Default is 1e8.
$returns
References
Note
This function uses
numpyfor all CPU arrays, andcupyfor all on-gpu array. It will convert all its array argument to the respective array library. The outputs will be converted back to the original array module and device.See also
This function is part of the optimizer registry. You can find other registered functions in this registry below:
Key
Function
"lsqr""lsmr""cg"