spyrit.core.inverse.Tikhonov.divide

Tikhonov.divide(y: tensor, gamma: tensor) tensor[source]

Computes the division \(y \cdot (\Sigma \alpha + (A \Sigma A^T))^{-1}\).

Measurements y are divided by the sum of the measurement covariance.

If self.approx is True, the inverse is approximated as a diagonal matrix, speeding up the computation. Otherwise, the inverse is computed with the whole matrix.

Args:

y (torch.tensor): Input measurement tensor. Shape \((*, M)\).

gamma (torch.tensor): Noise covariance tensor. Shape \((*, M, M)\).

Returns:

torch.tensor: The divided tensor. Shape \((*, M)\).

Example:
>>> from spyrit.core.meas import Linear
>>> M, N = 32, 64
>>> meas_op = Linear(torch.rand([M,N]), meas_shape=(1,N))
>>> sigma = torch.rand(N,N)
>>> tikho = Tikhonov(meas_op, sigma, approx=False, reshape_output=True)
>>> y = torch.rand(85, 3, M)
>>> gamma = torch.eye(M).expand(85, 3, M, M)
>>> print(tikho.divide(y, gamma).shape)
torch.Size([85, 3, 32])