GainGenerator#
- class deepinv.physics.generator.GainGenerator(gain_min=0.1, gain_max=0.4, rng=None, device='cpu', dtype=torch.float32)[source]#
Bases:
PhysicsGeneratorGenerator 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])