spyrit.core.recon.PinvNet.reconstruct

PinvNet.reconstruct(y)

Apply the reconstruction modules to the input measurements.

The signal is reconstructed using the reconstruction modules stored in the network under the key recon_modules. They are all successively applied to the input tensor y.

Args:

y (torch.tensor): Input measurement tensor. It usually has measurements in the last dimension.

Returns:

torch.tensor: Output tensor. Its shape depends on the output of the reconstruction 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)
>>> y = torch.ones(10, 2)
>>> z = net.reconstruct(y)
>>> print(z.shape)
torch.Size([10, 5])
>>> print(z)
tensor([[...],
        [...],
        [...],
        [...],
        [...],
        [...],
        [...],
        [...],
        [...],
        [...