spyrit.core.recon.DCNet.acquire
- DCNet.acquire(x)
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 = lambda x: x*2 # >>> acqu2 = lambda x: x - 10 # >>> acqu = nn.Sequential(acqu1, acqu2) # >>> recon1 = lambda x: (x + 10) / 2 # >>> recon = nn.Sequential(recon1) # >>> net = FullNet(acqu, recon) # >>> x = torch.tensor(5.0) # >>> z = net.acquire(x) # >>> print(z) tensor(0.0000)