spyrit.core.prep.Rescale

class spyrit.core.prep.Rescale(alpha)[source]

Bases: Module

Rescale measurements as

\[m = \frac{y}{\alpha}\]

where \(y\) is the input tensor and \(\alpha\) represents some gain.

Note

This rescale the input tensor from \([0,\alpha]\) to \([0,1]\). When measurements are simulated using some gain factor (e.g., Poisson corrupted measurements), the gain is compensated for.

Args:

alpha (float): Gain \(\alpha\).

Attributes:

alpha (float): Gain \(\alpha\).

Methods

forward(y)

Rescale the tensor by dividing it by \(\alpha\).

sigma(v)

Rescale the variance of the measurements