loss_l2_AHreg#
- mrinufft.extras.optim.loss_l2_AHreg(image: ndarray[tuple[int, ...], dtype[_ScalarType_co]], operator: FourierOperatorBase, kspace_data: ndarray[tuple[int, ...], dtype[_ScalarType_co]], *args, **kwargs)[source]#
Compute the norm of the residual in the image domain.
- Parameters:
image (NDArray) – Current image estimate. Shape and dtype must be compatible with the operator.
operator (FourierOperatorBase) – The NUFFT (non-uniform FFT) operator used for forward modeling.
kspace_data (NDArray) – Measured k-space data. Shape must match the output of the operator.op(image).
- Returns:
norm_res – The computed L2 regularized least squares loss value(s). If batched, shape = (n_batchs,).
- Return type:
float or NDArray
Notes
Batch dimension is preserved if present.
This function can be used as a callback in cg or lsqr method to keep track of the convergence.
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.