Loss#
- class deepinv.loss.Loss[source]#
Bases:
Module
Base class for all loss functions.
Sets a template for the loss functions, whose forward method must follow the input parameters in
deepinv.loss.Loss.forward()
.- adapt_model(model, **kwargs)[source]#
Some loss functions require the model forward call to be adapted before the forward pass.
- Parameters:
model (torch.nn.Module) – reconstruction model
- forward(x_net, x, y, physics, model, **kwargs)[source]#
Computes the loss.
- Parameters:
x_net (torch.Tensor) – Reconstructed image \(\inverse{y}\).
x (torch.Tensor) – Reference image.
y (torch.Tensor) – Measurement.
physics (deepinv.physics.Physics) – Forward operator associated with the measurements.
model (torch.nn.Module) – Reconstruction function.
- Returns:
(
torch.Tensor
) loss, the tensor size might be (1,) or (batch size,).- Return type:
Examples using Loss
:#

Imaging inverse problems with adversarial networks

Self-supervised MRI reconstruction with Artifact2Artifact

Self-supervised learning with Equivariant Imaging for MRI.

Self-supervised learning from incomplete measurements of multiple operators.

Self-supervised denoising with the Neighbor2Neighbor loss.

Self-supervised denoising with the Generalized R2R loss.

Self-supervised learning with measurement splitting

Deep Equilibrium (DEQ) algorithms for image deblurring

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

Unfolded Chambolle-Pock for constrained image inpainting