spyrit.core.noise.PoissonApproxGaussSameNoise.forward

PoissonApproxGaussSameNoise.forward(x: tensor) tensor[source]

Simulates measurements corrupted by Poisson noise

Args:

x: Batch of images

Shape:
  • x: \((*, N)\)

  • Output: \((*, M)\)

Example 1: Two noisy measurement vectors from a Linear measurement operator
>>> H = torch.rand([400,32*32])
>>> meas_op = Linear(H)
>>> noise_op = PoissonApproxGaussSameNoise(meas_op, 10.0)
>>> x = torch.FloatTensor(10, 32*32).uniform_(-1, 1)
>>> y = noise_op(x)
>>> print(y.shape)
>>> print(f"Measurements in ({torch.min(y):.2f} , {torch.max(y):.2f})")
>>> y = noise_op(x)
>>> print(f"Measurements in ({torch.min(y):.2f} , {torch.max(y):.2f})")
torch.Size([10, 400])
Measurements in (2255.57 , 2911.18)
Measurements in (2226.49 , 2934.42)
Example 2: Two noisy measurement vectors from a HadamSplit operator
>>> Perm = torch.rand([32*32,32*32])
>>> meas_op = HadamSplit(H, Perm, 32, 32)
>>> noise_op = PoissonApproxGaussSameNoise(meas_op, 200.0)
>>> x = torch.FloatTensor(10, 32*32).uniform_(-1, 1)
>>> y = noise_op(x)
>>> print(y.shape)
>>> print(f"Measurements in ({torch.min(y):.2f} , {torch.max(y):.2f})")
>>> y = noise_op(x)
>>> print(f"Measurements in ({torch.min(y):.2f} , {torch.max(y):.2f})")
torch.Size([10, 800])
Measurements in (0.00 , 55951.41)
Measurements in (0.00 , 56216.86)