This is documentation for an old release of SciPy (version 0.17.1). Read this page in the documentation of the latest stable release (version 1.15.1).
scipy.special.kl_div¶
- scipy.special.kl_div(x, y) = <ufunc 'kl_div'>¶
Elementwise function for computing Kullback-Leibler divergence.
kl_div(x,y)={xlog(x/y)−x+yx>0,y>0yx=0,y≥0∞otherwiseParameters: x : ndarray
First input array.
y : ndarray
Second input array.
Returns: res : ndarray
Output array.
Notes
This function is non-negative and is jointly convex in x and y.
New in version 0.14.0.