tick.prox.ProxElasticNet

class tick.prox.ProxElasticNet(strength: float, ratio: float, range: tuple = None, positive=False)[source]

Proximal operator of the ElasticNet regularization.

Parameters

strength : float

Level of ElasticNet regularization

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

ratio : float, default=0

The ElasticNet mixing parameter, with 0 <= ratio <= 1. For ratio = 0 this is ridge (L2) regularization For ratio = 1 this is lasso (L1) regularization For 0 < ratio < 1, the regularization is a linear combination of L1 and L2.

positive : bool, default=`False`

If True, apply the penalization together with a projection onto the set of vectors with non-negative entries

Attributes

dtype : {'float64', 'float32'}

Type of the arrays used.

__init__(strength: float, ratio: float, range: tuple = None, positive=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:

\[argmin_x \big( f(x) + \frac{1}{2} \|x - v\|_2^2 \big)\]
Parameters

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 amount

  • If 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 given out. Otherwise, a new vector is created.

Returns

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)[source]

Returns the value of the penalization at coeffs

Parameters

coeffs : numpy.ndarray, shape=(n_coeffs,)

The value of the penalization is computed at this point

Returns

output : float

Value of the penalization at coeffs