SupLoss#
- class deepinv.loss.SupLoss(metric: Metric | Module = MSELoss())[source]#
Bases:
Loss
Standard supervised loss
The supervised loss is defined as
\[\|x-\inverse{y}\|^2\]where \(\inverse{y}\) is the reconstructed signal and \(x\) is the ground truth target.
By default, the error is computed using the MSE metric, however any other metric (e.g., \(\ell_1\)) can be used as well. If called with arguments
x_net, x
, this is simply a wrapper for the metricmetric
.- Parameters:
metric (Metric, torch.nn.Module) – metric used for computing data consistency, which is set as the mean squared error by default.
- forward(x_net, x, **kwargs)[source]#
Computes the loss.
- Parameters:
x_net (torch.Tensor) – Reconstructed image :math:inverse{y}.
x (torch.Tensor) – Target (ground-truth) image.
- Returns:
(torch.Tensor) loss.
Examples using SupLoss
:#
Training a reconstruction network.
Learned Iterative Soft-Thresholding Algorithm (LISTA) for compressed sensing
Vanilla Unfolded algorithm for super-resolution
Learned iterative custom prior
Deep Equilibrium (DEQ) algorithms for image deblurring
Learned Primal-Dual algorithm for CT scan.
Unfolded Chambolle-Pock for constrained image inpainting
Imaging inverse problems with adversarial networks