NRMSE#

class deepinv.loss.metric.NRMSE(method='l2', **kwargs)[source]#

Bases: NMSE

Normalized Root Mean Squared Error metric.

Calculates

\[\operatorname{NRMSE}(\hat{x},x) = \frac{\|\hat{x}-x\|_2}{\|x\|_2} = \sqrt{\operatorname{NMSE}(\hat{x},x)},\]

where \(\hat{x}=\inverse{y}\).

Note

By default, no reduction is performed in the batch dimension.

Example:

>>> import torch
>>> from deepinv.loss.metric import NRMSE
>>> m = NRMSE()
>>> x_net = x = torch.ones(3, 2, 8, 8)
>>> m(x_net, x)
tensor([0., 0., 0.])
Parameters:
  • method (str) – normalisation method. Currently only supports l2.

  • complex_abs (bool) – perform complex magnitude before passing data to metric function.

  • reduction (str) – method used to reduce scores over the batch dimension.

  • norm_inputs (str) – optional input normalization.

  • center_crop (int, tuple[int], None) – optional spatial center crop.

Examples using NRMSE:#

Positron emission tomography (PET) in 2D

Positron emission tomography (PET) in 2D

Positron emission tomography (PET) in 3D

Positron emission tomography (PET) in 3D