spyrit.core.inverse.TikhonovMeasurementPriorDiag

class spyrit.core.inverse.TikhonovMeasurementPriorDiag(meas_op: HadamSplit2d, sigma: tensor, reshape_output: bool = False)[source]

Bases: Module

Tikhonov regularisation with prior in the measurement domain.

Considering linear measurements \(m = Hx \in\mathbb{R}^M\), where \(H = GF\) is the measurement matrix and \(x\in\mathbb{R}^N\) is a vectorized image, it estimates \(x\) from \(m\) by approximately minimizing

\[\|m - GFx \|^2_{\Sigma^{-1}_\alpha} + \|F(x - x_0)\|^2_{\Sigma^{-1}}\]

where \(x_0\in\mathbb{R}^N\) is a mean image prior, \(\Sigma\in\mathbb{R}^{N\times N}\) is a covariance prior, and \(\Sigma_\alpha\in\mathbb{R}^{M\times M}\) is the measurement noise covariance. The matrix \(G\in\mathbb{R}^{M\times N}\) is a subsampling matrix.

Note

The class is instantiated from \(\Sigma\), which represents the covariance of \(Fx\).

Args:

meas_op: A Hadamard measurement operator (see spyrit.core.meas.HadamSplit2d).

sigma: Measurement covariance prior with shape \(N\) x \(N\).

Attributes:

meas_op: Measurement operator initialized as meas_op.

denoise_weights: The learnable denoising layer initialized from \(\Sigma_1\). This layer is a nn.Parameter.

comp: The learnable matrix initialized from \(\Sigma_{21}\). This matrix is a nn.Parameter.

Example:
>>> from spyrit.core.meas import HadamSplit2d
>>> from spyrit.core.inverse import TikhonovMeasurementPriorDiag
>>> import torch
>>> acqu = HadamSplit2d(32, 400)
>>> sigma = torch.rand([32*32, 32*32])
>>> recon_op = TikhonovMeasurementPriorDiag(acqu, sigma)
>>> y = torch.rand([10, 3, 400])
>>> x0 = torch.rand([10, 3, 32, 32])
>>> var = torch.rand([10, 3, 400])
>>> x = recon_op(y, x0, var)
>>> print(x.shape)
torch.Size([10, 3, 32, 32])

Methods

forward(x, x_0, var)

Computes the Tikhonov regularization with prior in the measurement domain.

forward_no_prior(x, var)

Computes the Tikhonov regularization with prior in the measurement domain.

wiener_denoise(x, var)

Returns a denoised version of the input tensor using the variance prior.