meddlr.metrics.functional.psnr#

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

Computes peak signal-to-noise ratio.

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 peak signal-to-noise ratio.

Return type

torch.Tensor