L1

class deepinv.optim.L1[source]

Bases: DataFidelity

\(\ell_1\) data fidelity term.

In this case, the data fidelity term is defined as

\[f(x) = \|Ax-y\|_1.\]
d(x, y)[source]

Computes the data fidelity distance \(\distance{u}{y}\).

Parameters:
Returns:

(torch.Tensor) data fidelity \(\distance{u}{y}\).

grad_d(x, y)[source]

Gradient of the gradient of the \(\ell_1\) norm, i.e.

\[\partial \datafid(x) = \operatorname{sign}(x-y)\]

Note

The gradient is not defined at \(x=y\).

Parameters:
  • x (torch.Tensor) – Variable \(x\) at which the gradient is computed.

  • y (torch.Tensor) – Data \(y\) of the same dimension as \(x\).

Returns:

(torch.Tensor) gradient of the \(\ell_1\) norm at x.

prox(x, y, physics, gamma=1.0, stepsize=None, crit_conv=1e-05, max_iter=100)[source]

Proximal operator of the \(\ell_1\) norm composed with A, i.e.

\[\operatorname{prox}_{\gamma \ell_1}(x) = \underset{u}{\text{argmin}} \,\, \gamma \|Au-y\|_1+\frac{1}{2}\|u-x\|_2^2.\]

Since no closed form is available for general measurement operators, we use a dual forward-backward algorithm.

Parameters:
  • x (torch.Tensor) – Variable \(x\) at which the proximity operator is computed.

  • y (torch.Tensor) – Data \(y\) of the same dimension as \(\forw{x}\).

  • physics (deepinv.physics.Physics) – physics model.

  • stepsize (float) – step-size of the dual-forward-backward algorithm.

  • crit_conv (float) – convergence criterion of the dual-forward-backward algorithm.

  • max_iter (int) – maximum number of iterations of the dual-forward-backward algorithm.

Returns:

(torch.Tensor) projection on the \(\ell_2\) ball of radius radius and centered in y.

prox_d(u, y, gamma=1.0)[source]

Proximal operator of the \(\ell_1\) norm, i.e.

\[\operatorname{prox}_{\gamma \ell_1}(x) = \underset{z}{\text{argmin}} \,\, \gamma \|z-y\|_1+\frac{1}{2}\|z-x\|_2^2\]

also known as the soft-thresholding operator.

Parameters:
  • u (torch.Tensor) – Variable \(u\) at which the proximity operator is computed.

  • y (torch.Tensor) – Data \(y\) of the same dimension as \(x\).

  • gamma (float) – stepsize (or soft-thresholding parameter).

Returns:

(torch.Tensor) soft-thresholding of u with parameter gamma.