MCLoss
- class deepinv.loss.MCLoss(metric: Metric | Module = MSELoss())[source]
Bases:
Loss
Measurement consistency loss
This loss enforces that the reconstructions are measurement-consistent, i.e., \(y=\forw{\inverse{y}}\).
The measurement consistency loss is defined as
\[\|y-\forw{\inverse{y}}\|^2\]where \(\inverse{y}\) is the reconstructed signal and \(A\) is a forward operator.
By default, the error is computed using the MSE metric, however any other metric (e.g., \(\ell_1\)) can be used as well.
- Parameters:
metric (Metric, torch.nn.Module) – metric used for computing data consistency, which is set as the mean squared error by default.
- forward(y, x_net, physics, **kwargs)[source]
Computes the measurement splitting loss
- Parameters:
y (torch.Tensor) – measurements.
x_net (torch.Tensor) – reconstructed image \(\inverse{y}\).
physics (deepinv.physics.Physics) – forward operator associated with the measurements.
- Returns:
(torch.Tensor) loss.
Examples using MCLoss
:
Image transformations for Equivariant Imaging
Self-supervised learning with Equivariant Imaging for MRI.
Self-supervised learning from incomplete measurements of multiple operators.