cg#
- mrinufft.extras.optim.cg(operator: FourierOperatorBase, kspace_data: ndarray[tuple[int, ...], dtype[_ScalarType_co]], damp: float = 0.0, x0: ndarray[tuple[int, ...], dtype[_ScalarType_co]] | None = None, x_init: ndarray[tuple[int, ...], dtype[_ScalarType_co]] | None = None, max_iter: int = 10, tol: float = 0.0001, progressbar: bool | tqdm_asyncio = True, callback: Callable | None = None)[source]#
Perform conjugate gradient (CG) optimization for image reconstruction.
The image is updated using the gradient of a data consistency term, and a velocity vector is used to accelerate convergence.
- Parameters:
$base_params
tol (float) – Tolerance for converge check.
$returns
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.