GainGenerator#
- class deepinv.physics.generator.GainGenerator(gain_min=0.1, gain_max=0.4, rng=None, device='cpu', dtype=torch.float32)[source]#
Bases:
PhysicsGenerator
Generator for the noise level \(\gamma\) in the
Poisson noise model
.The gain is sampled uniformly from the interval \([\gamma_\text{min}, \gamma_\text{max}]\).
- Parameters:
gain_min (float) – minimum noise level
gain_max (float) – maximum noise level
rng (torch.Generator) – random number generator
device (str) – device where the tensor is stored
dtype (torch.dtype) – data type of the generated tensor.
- Examples:
>>> from deepinv.physics.generator import GainGenerator >>> generator = GainGenerator() >>> params = generator.step(seed=0) # params(['gain']) >>> print(params['gain']) tensor([0.2489])