spyrit.core.noise.Poisson.forward
- Poisson.forward(x)[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
Linearmeasurement operator >>> H = torch.rand([400,32*32]) >>> meas_op = Linear(H) >>> noise_op = Poisson(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 (2249.00 , 2896.00) Measurements in (2237.00 , 2880.00)
- Example 2: Two noisy measurement vectors from a
HadamSplitoperator >>> Perm = torch.rand([32*32,32*32]) >>> meas_op = HadamSplit(H, Perm, 32, 32) >>> noise_op = Poisson(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 , 55338.00) Measurements in (0.00 , 55077.00)
- Example 3: Two noisy measurement vectors from a
LinearSplitoperator >>> H = torch.rand(24,64) >>> meas_op = LinearSplit(H) >>> noise_op = Poisson(meas_op, 50.0) >>> x = torch.FloatTensor(10, 64, 92).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, 48, 92]) Measurements in (500.00 , 1134.00) Measurements in (465.00 , 1140.00)