GroupL2SoftThresholding#

class mrinufft.trajectories.projection.GroupL2SoftThresholding(shape: tuple[int, ...], alphas: ndarray[tuple[int, ...], dtype[_ScalarType_co]])[source]#

Bases: ProxOperator

Group L2 Soft Thresholding (Shrinkage) Operator.

This operator applies a soft-thresholding on the L2 norm of vectors grouped along the last dimension. It is effectively the proximal operator of the Group Lasso (L2,1) penalty.

The logic follows: \(y = x * max(0, ||x|| - alpha) / ||x||\)

Parameters:
  • shape (tuple[int, ...]) – The shape of the input vector, expected to be (Nc, Ns, D).

  • alphas (NDArray or float) – The threshold parameter(s). Can be a scalar or a vector of shape (D,). If a vector is provided, the thresholding is applied per-channel broadcasting against the joint L2 norm.

Methods

__init__

affine_addition

Affine addition

chain

Chain

grad

Gradient of the Moreau envelope of the function.

postcomposition

Postcomposition

precomposition

Precomposition

prox

Apply the Group L2 Soft Thresholding.

proxdual

Attributes

H

Adjoint operator - swaps prox and proxdual

__call__(x: ndarray[tuple[int, ...], dtype[_ScalarType_co]]) bool[source]#

Evaluate the regularization function value (L2,1 norm weighted by alphas).

Note: This returns the penalty value, not a boolean check.

Note

This function uses numpy for all CPU arrays, and cupy for all on-gpu array. It will convert all its array argument to the respective array library. The outputs will be converted back to the original array module and device.

Return type:

bool

prox(x: ndarray[tuple[int, ...], dtype[_ScalarType_co]], tau: float, eps: float = 1e-10) ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]#

Apply the Group L2 Soft Thresholding.

y = x * ( ||x||_2 - (alphas * tau) )_+ / ||x||_2

Note

This function uses numpy for all CPU arrays, and cupy for all on-gpu array. It will convert all its array argument to the respective array library. The outputs will be converted back to the original array module and device.

Return type:

ndarray[tuple[int, …], dtype[_ScalarType_co]]