spyrit.core.recon.FullNet.acquire

FullNet.acquire(x)[source]

Apply the measurement modules to the input signal.

The measurements are simulated using the measurement modules stored in the network under the key acqu_modules. They are all successively applied to the input tensor x.

Args:

x (torch.tensor): Input tensor. For images, it is usually shaped (b, c, h, w) where b is the batch size, c is the number of channels, and h and w are the height and width of the images.

Returns:

torch.tensor: Output tensor. Its shape depends on the output of the measurement modules.

Example:
>>> acqu1 = nn.Linear(10,5)
>>> acqu2 = nn.Sigmoid()
>>> acqu = nn.Sequential(acqu1, acqu2)
>>> recon1 = nn.Linear(2,5)
>>> recon = nn.Sequential(recon1)
>>> net = FullNet(acqu, recon)
>>> x = torch.ones(2, 10)
>>> z = net.acquire(x)
>>> print(z.shape)
torch.Size([2, 5])
>>> print(z)
tensor([[...],
        [...]], grad_fn=<SigmoidBackward0>)