el0ps.datafit.KullbackLeibler¶
- class el0ps.datafit.KullbackLeibler(y, e=1e-08)¶
Kullback-Leibler datafit function.
The function is defined as
\[f(\mathbf{w}) = \sum_{i=1}^m y_i \log(\tfrac{y_i}{w_i + e}) + (w_i + e) - y_i\]for some \(\mathbf{y} \in \mathbb{R}_+^m\) and \(e \geq 0\). The function returns \(+\infty\) whenever \(w_i + e \leq 0\) for some \(i \in \{1,\dots,m\}\).
- Parameters:
- yNDArray
Data vector.
- efloat = 1e-8
Smoothing parameter.
- __init__(y, e=1e-08)¶
Methods
__init__
(y[, e])conjugate
(w)Value of the convex conjugate of the function at
w
.get_spec
()Specify the numba types of the class attributes.
gradient
(w)Value of gradient at
w
.gradient_lipschitz_constant
()Lipschitz constant of the gradient.
params_to_dict
()Returns the parameters name and value used to initialize the class instance.
value
(w)Value of the function at
w
.