spyrit.core.prep.Unsplit
- class spyrit.core.prep.Unsplit[source]
Bases:
ModulePreprocess measurements simulated using split measurement operator.
Given measurements \(y\in\mathbb{R}^{2M}\), it computes either \(y_+ - y_-\) or \(y_+ + y_-\). The positive and negative measurements \(y_+\in\mathbb{R}^{M}\) and \(y_-\in\mathbb{R}^{M}\) are given by
\[\begin{split}y_+ = \begin{bmatrix} y[0]\\ y[2]\\ y[2M-2]\\ \end{bmatrix} \quad\text{and}\quad y_- = \begin{bmatrix} y[1]\\ y[3]\\ y[2M-1]\\ \end{bmatrix}.\end{split}\]- Args:
None
- Attributes:
None
- Example:
>>> import torch >>> import spyrit.core.meas as meas >>> import spyrit.core.prep as prep >>> H = torch.rand([400,32]) >>> img = torch.rand([10,32]) >>> meas_op = meas.LinearSplit(H) >>> split_op = prep.Unsplit() >>> y = meas_op(img) >>> m = split_op(y) >>> print(y.shape) torch.Size([10, 800]) >>> print(m.shape) torch.Size([10, 400])
Methods
forward(y[, mode])Preprocess measurements simulated using split measurement operator.