meddlr.metrics.functional.nrmse#

meddlr.metrics.functional.nrmse(pred: Tensor, target: Tensor, im_type: Optional[str] = None) Tensor[source]#

Computes normalized root mean squared error.

Normalization is done with respect to \(\sqrt{\frac{\sum^N target[i]^2}{N}}\).

Parameters
  • pred (torch.Tensor) – The prediction. Either a complex or real tensor.

  • target (torch.Tensor) – The target. Either a complex or real tensor.

  • im_type (str, optional) – The image type to compute metric on. This only applies for complex inputs, otherwise ignored. Either 'magnitude' (default) to compute metric on magnitude images or 'phase' to compute metric on phase/angle images. If None, computed on complex images.

Returns

The normalized root mean squared error.

Return type

torch.Tensor