tick.prox.
ProxBinarsity
(strength: float, blocks_start, blocks_length, range: tuple = None, positive: bool = False)[source]¶Proximal operator of binarsity. It is simply a succession of two steps on
different intervals: ProxTV
plus a centering translation. More
precisely, total-variation regularization is applied on a coefficient vector
being a concatenation of multiple coefficient vectors corresponding to
blocks, followed by centering within sub-blocks. Blocks (non-overlapping)
are specified by the blocks_start
and blocks_length
parameters.
strength : float
Level of total-variation penalization
blocks_start : np.array
, shape=(n_blocks,)
First entry of each block
blocks_length : np.array
, shape=(n_blocks,)
Size of each block
range : tuple
of two int
, default=`None`
Range on which the prox is applied. If
None
then the prox is applied on the whole vector
positive : bool
, default=`False`
If True, apply in the end a projection onto the set of vectors with non-negative entries
n_blocks : int
Number of blocks
dtype : {'float64', 'float32'}
Type of the arrays used.
References
ProxBinarsity uses the fast-TV algorithm described in:
Condat, L. (2012). A Direct Algorithm for 1D Total Variation Denoising.
__init__
(strength: float, blocks_start, blocks_length, range: tuple = None, positive: bool = False)[source]¶Initialize self. See help(type(self)) for accurate signature.
call
(coeffs, step=1.0, out=None)¶Apply proximal operator on a vector. It computes:
coeffs : numpy.ndarray
, shape=(n_coeffs,)
Input vector on which is applied the proximal operator
step : float
or np.array
, default=1.
The amount of penalization is multiplied by this amount
If
float
, the amount of penalization is multiplied by this amountIf
np.array
, then each coordinate of coeffs (within the given range), receives an amount of penalization multiplied by t (available only for separable prox)
out : numpy.ndarray
, shape=(n_params,), default=None
If not
None
, the output is stored in the givenout
. Otherwise, a new vector is created.
output : numpy.ndarray
, shape=(n_coeffs,)
Same object as out
Notes
step
must have the same size as coeffs
whenever range is
None
, or a size matching the one given by the range
otherwise
value
(coeffs: numpy.ndarray)¶Returns the value of the penalization at coeffs
coeffs : numpy.array
, shape=(n_coeffs,)
The value of the penalization is computed at this point
output : float
Value of the penalization at
coeffs
tick.prox.ProxBinarsity
¶