BlindRLIteration#
- class deepinv.optim.optim_iterators.BlindRLIteration(k_prior=None, normalize_kernel=True, use_fft=False, eps=1e-8, **kwargs)[source]#
Bases:
OptimIteratorIterator for Blind Richardson-Lucy deconvolution.
This iterator performs one step to estimate the next kernel, and one step to estimate the next image.
The current iterate is stored as
X["est"] = (x, k). The kernel update assumes 2D circular convolution and a spatially invariant kernel shared by all image channels.- Parameters:
k_prior (deepinv.optim.Prior, None) – optional kernel prior. Default:
None.normalize_kernel (bool) – whether to normalize the kernel to unit sum. Default:
True.use_fft (bool) – whether to use the FFT implementations for convolutions. Default:
False.eps (float) – numerical stability constant used for divisions. Default:
1e-8.
- forward(X, cur_data_fidelity, cur_prior, cur_params, y, physics, *args, **kwargs)[source]#
Single Blind Richardson-Lucy iteration.
- Parameters:
X (dict[str, tuple[torch.Tensor, torch.Tensor] | torch.Tensor]) – Current iterate with
X["est"] = (x, k).cur_data_fidelity (deepinv.optim.DataFidelity) – Data fidelity term.
cur_prior (deepinv.optim.Prior) – Image prior.
cur_params (dict) – Parameters containing
x_steps,k_steps,lambda_reg_x,lambda_reg_k,g_paramandg_param_kernel.y (torch.Tensor) – Blurry observation of shape
(B, C, H, W).physics (deepinv.physics.Physics) – Blur physics updated in-place with the current kernel for the image update.
- Returns:
Dictionary
{"est": (x, k), "cost": F, "it": it}containing the updated image, kernel, cost, and iteration number.- Return type: