spyrit.core.meas.DynamicLinearSplit.adjoint

DynamicLinearSplit.adjoint(y: tensor, unvectorize=False)[source]

Apply adjoint of matrix \(A_{\rm{dyn}}\).

It computes

\[x = A_{\rm{dyn}}^\top y,\]

where \(A_{\rm{dyn}} \in \mathbb{R}^{2M\times L}\) is the dynamic acquisition matrix (that may contain negative values due to warping) and \(y \in \mathbb{R}^{2M}\) is a measurement vector.

Warning

This supposes the dynamic measurement matrix \(A_{\rm{dyn}}\) has been set using the build_dynamic_forward() method. An error will be raised otherwise.

Note

The acquisition matrix \(A_{\rm{dyn}}\) is given by self.A_dyn. It may contains negative values due to warping.

Args:

y (torch.tensor): Measurement \(y\) whose dimensions self.meas_dims must have shape self.meas_shape.

Returns:

torch.tensor: A batch of signals \(x\) with shape \((*, N)\) where \(*\) is the same as for m.

Example:
>>> import torch
>>> from spyrit.core.noise import Poisson
>>> from spyrit.core.warp import DeformationField
>>> from spyrit.core.meas import DynamicLinearSplit
>>>
>>> def_field = DeformationField(torch.rand([800, 50, 50, 2]) * 2 - 1)  # dummy deformation field with 400 frames
>>> x = torch.rand([1, 3, 50, 50])  # dummy RGB reference image of size 50x50
>>> x_motion = def_field(x)  # dummy video obtained by warping x with def_field
>>> H = torch.rand([400, 40*40])  # dummy static measurement matrix
>>>
>>> alpha = 5  # noise level
>>> noise_op = Poisson(alpha=alpha, g=1/alpha)
>>> meas_op = DynamicLinearSplit(H, time_dim=1, meas_shape=(40, 40), img_shape=(50, 50), noise_model=noise_op)
>>> print(meas_op)
DynamicLinearSplit(
  (noise_model): Poisson()
)
>>>
>>> meas_op.build_dynamic_forward(def_field)
>>> y = meas_op(x_motion)  # simulate noisy dynamic measurements
>>> A_dyn_adj_x = meas_op.adjoint(y)  # apply adjoint of dynamic measurement matrix
>>> print(A_dyn_adj_x.shape)
torch.Size([1, 3, 2500])