spyrit.core.meas.DynamicLinear.adjoint
- DynamicLinear.adjoint(m: tensor, unvectorize=False)
Apply adjoint of matrix H.
It computes
\[x = H^Tm,\]where \(H^T\in\mathbb{R}^{N\times M}\) is the adjoint of the acquisition matrix, \(m \in \mathbb{R}^M\) is a measurement.
- Args:
m(torch.tensor): A batch of measurement \(m\) of shape \((*, M)\) where \(*\) denotes all the dimensions that are not included inself.meas_dimsunvectorize(bool, optional): Whether to unvectorize the measurement dimensions. This callsunvectorize()after mutiplication by the adjoint. Defaults to False.- Returns:
torch.tensor: A batch of signals \(x\). IfunvectorizeisFalse, \(x\) has shape \((*, N)\) where \(*\) is the same as form. IfunvectorizeisTrue, \(x\) is reshaped such that the dimensionsself.meas_dimsmatch the measurement shapeself.meas_shape.- Example:
Example 2: (3, 4) measurements of length 10 produces (3, 4) signals of length 10.
>>> H = torch.randn(10, 15) >>> meas_op = Linear(H) >>> m = torch.randn(3, 4, 10) >>> x = meas_op.adjoint(m) >>> print(x.shape) torch.Size([3, 4, 15])
Example 2: 3 measurements of length 10 produces 3 signals of length 60 >>> import spyrit.core.meas as meas >>> H = torch.randn(10, 60) >>> meas_op = meas.Linear(H, meas_shape=(15, 4)) >>> m = torch.randn(3, 10) >>> x = meas_op.adjoint(m) >>> print(x.shape) torch.Size([3, 60])
Using unvectorize=True produces 3 signals of length (15, 4)
>>> x = meas_op.adjoint(m, unvectorize=True) >>> print(x.shape) torch.Size([3, 15, 4])