L1

class colibri.recovery.terms.fidelity.L1[source]

Bases: Module

L1 fidelity

\[f(\mathbf{x}) = ||\forwardLinear(\mathbf{x}) - \mathbf{y}||_1\]
forward(x, y, H)[source]

Computes the L1 fidelity term.

Parameters:
  • x (torch.Tensor) – The image to be reconstructed.

  • y (torch.Tensor) – The measurement data to be reconstructed.

  • H (function) – The forward model.

Returns:

The L1 fidelity term.

Return type:

torch.Tensor

grad(x, y, H)[source]

Compute the gradient of the L1 fidelity term.

\[\nabla f(\mathbf{x}) = \nabla \frac{1}{2}||\forwardLinear(\mathbf{x}) - \mathbf{y}||_1\]
Parameters:
  • x (torch.Tensor) – Input tensor.

  • y (torch.Tensor) – The measurement data to be reconstructed.

  • H (function) – Forward model.

Returns:

Gradient of the L1 fidelity term.

Return type:

torch.Tensor