spyrit.core.recon.Pinv1Net.forward

Pinv1Net.forward(x)[source]

Full pipeline (image-to-image mapping)

Args:

x (torch.tensor): Ground-truth images with shape \((b,c,h,w)\).

Output:

torch.tensor: Reconstructed images with shape \((b,c,h,w)\).

Example:
>>> b,c,h,w = 10,1,48,64
>>> H = torch.rand(15,w)
>>> meas = Linear(H, meas_shape=(1,w))
>>> noise = NoNoise(meas)
>>> prep = DirectPoisson(1.0, meas)
>>> recnet = Pinv1Net(noise, prep)
>>> x = torch.FloatTensor(b,c,h,n).uniform_(-1, 1)
>>> z = recnet(x)
>>> print(z.shape)
>>> print(torch.linalg.norm(x - z)/torch.linalg.norm(x))
torch.Size([10, 1, 64, 64])
tensor(5.8912e-06)