spyrit.core.noise.NoNoise.forward
- NoNoise.forward(x: tensor) tensor[source]
Simulates measurements
- Args:
x: Batch of images. The input is directly passed to the measurement operator, so its shape depends on the type of the measurement operator.- Output:
The batch of measurements. Its shape depends on the input shape.
- Shape:
x: \((*, h, w)\) if self.meas_op is a static measurement operator, \((*, t, c, h, w)\) if it is a dynamic measurement operator.Output: \((*, M)\) (static measurements) or (*, c, M) (dynamic measurements)- Example 1: Using a
Linearmeasurement operator >>> x = torch.FloatTensor(10, 3, 32, 32).uniform_(-1, 1) >>> linear_acq = NoNoise(linear_op) >>> y = linear_acq(x) >>> print(y.shape) torch.Size([10, 3, 400])
- Example 2: Using a
DynamicLinearmeasurement operator >>> x = torch.FloatTensor(10, 400, 3, 32, 32).uniform_(-1, 1) >>> dyn_acq = DynamicLinear(torch.rand(400, 32*32)) >>> noise_acq = NoNoise(dyn_acq) >>> y = split_acq(x) >>> print(y.shape) torch.Size([10, 3, 400])