SupLoss#

class deepinv.loss.SupLoss(metric=torch.nn.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 metric metric.

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:
Returns:

(torch.Tensor) loss.

Examples using SupLoss:#

Imaging inverse problems with adversarial networks

Imaging inverse problems with adversarial networks

Remote sensing with satellite images

Remote sensing with satellite images

Tour of MRI functionality in DeepInverse

Tour of MRI functionality in DeepInverse

Training a reconstruction network.

Training a reconstruction network.

Deep Equilibrium (DEQ) algorithms for image deblurring

Deep Equilibrium (DEQ) algorithms for image deblurring

Learned Iterative Soft-Thresholding Algorithm (LISTA) for compressed sensing

Learned Iterative Soft-Thresholding Algorithm (LISTA) for compressed sensing

Learned iterative custom prior

Learned iterative custom prior

Learned Primal-Dual algorithm for CT scan.

Learned Primal-Dual algorithm for CT scan.

Unfolded Chambolle-Pock for constrained image inpainting

Unfolded Chambolle-Pock for constrained image inpainting

Vanilla Unfolded algorithm for super-resolution

Vanilla Unfolded algorithm for super-resolution