pyproximal.L0ยถ
- class pyproximal.L0(sigma: float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | Callable[[int], float | ndarray[tuple[Any, ...], dtype[_ScalarT]]] = 1.0)[source]ยถ
\(L_0\) norm proximal operator.
Proximal operator of the \(\ell_0\) norm: \(\sigma\|\mathbf{x}\|_0 = \text{count}(x_i \ne 0)\).
- Parameters:
- sigma
floatornumpy.ndarrayorfunc, optional Multiplicative coefficient of L0 norm. This can be a constant number, a list of values (for multidimensional inputs, acting on the second dimension) or a function that is called passing a counter which keeps track of how many times the
proxmethod has been invoked before and returns a scalar (or a list of)sigmato be used.
- sigma
Notes
The \(\ell_0\) proximal operator is defined as:
\[\begin{split}\prox_{\tau \sigma \|\cdot\|_0}(\mathbf{x}) = \operatorname{hard}(\mathbf{x}, \tau \sigma) = \begin{cases} x_i, & x_i < -\tau \sigma \\ 0, & -\tau\sigma \leq x_i \leq \tau\sigma \\ x_i, & x_i > \tau\sigma\\ \end{cases}\end{split}\]where \(\operatorname{hard}\) is the so-called called hard thresholding.
Methods
__init__([sigma])affine_addition(v)Affine addition
chain(g)Chain
grad(x)Gradient of the Moreau envelope of the function.
postcomposition(sigma)Postcomposition
precomposition(a, b)Precomposition
prox(*args, **kwargs)proxdual(**kwargs)