SNR#

class deepinv.loss.metric.SNR(**kwargs)[source]#

Bases: Metric

Compute the signal-to-noise ratio (SNR)

The signal-to-noise ratio (in dB) associated to a ground truth signal \(x\) and a noisy estimate \(\hat{x} = \inverse{y}\) is defined by

\[\mathrm{SNR} = 10 \log_{10} \left( \frac{\|x\|_2^2}{\|x - y\|_2^2} \right).\]

Note

The input is assumed to be batched and the SNR is computed for each element independently.

Parameters:
Returns:

(torch.Tensor) The SNR value in decibels (dB).