SurePoissonLoss#

class deepinv.loss.SurePoissonLoss(gain, tau=1e-3, rng=None)[source]#

Bases: Loss

SURE loss for Poisson noise

The loss is designed for the following noise model:

\[y = \gamma z \quad \text{with}\quad z\sim \mathcal{P}(\frac{u}{\gamma}), \quad u=A(x).\]

The loss is computed as

\[\frac{1}{m}\|y-A\inverse{y}\|_2^2-\frac{\gamma}{m} 1^{\top}y +\frac{2\gamma}{m\tau}(b\odot y)^{\top} \left(A\inverse{y+\tau b}-A\inverse{y}\right)\]

where \(R\) is the trainable network, \(y\) is the noisy measurement vector of size \(m\), \(b\) is a Bernoulli random variable taking values of -1 and 1 each with a probability of 0.5, \(\tau\) is a small positive number, and \(\odot\) is an elementwise multiplication.

See Le et al.[1] for details. If the measurement data is truly Poisson this loss is an unbiased estimator of the mean squared loss \(\frac{1}{m}\|u-A\inverse{y}\|_2^2\) where \(z\) is the noiseless measurement.

Warning

The loss can be sensitive to the choice of \(\tau\), which should be proportional to the size of \(y\). The default value of 0.01 is adapted to \(y\) vectors with entries in \([0,1]\).

Parameters:
  • gain (float) – Gain of the Poisson Noise.

  • tau (float) – Approximation constant for the Monte Carlo approximation of the divergence.

  • rng (torch.Generator) – Optional random number generator. Default is None.


References:

forward(y, x_net, physics, model, **kwargs)[source]#

Computes the SURE loss.

Parameters:
Returns:

torch.Tensor loss of size (batch_size,)

Return type:

torch.Tensor

property name: bool#

The name of the loss function. This attribute is deprecated in favor of the class name and it will be removed in a future version.

Examples using SurePoissonLoss:#

Self-supervised denoising with the SURE loss.

Self-supervised denoising with the SURE loss.