spyrit.core.noise.Gaussian
- class spyrit.core.noise.Gaussian(sigma: float = 0.1)[source]
Bases:
ModuleSimulate measurements corrupted by additive Gaussian noise
\[y \sim \mathcal{N}\left(\mu = z, \sigma^2\right),\]where \(\mathcal{N}(\mu, \sigma^2)\) is a Gaussian distribution with mean \(\mu\) and variance \(\sigma^2\) and \(z\) are the noiseless measurements.
The class is constructed from the standard deviation of the noise \(\sigma\).
- Args:
sigma(float): Standard deviation of the noise \(\sigma\)- Example:
>>> noise = Gaussian(1.0) >>> z = torch.tensor([1., 3., 6.]) >>> y = noise(z) >>> print(y) tensor([...])
Methods
forward(z)Simulates measurements corrupted by additive Gaussian noise