scipy.special.entr

scipy.special.entr(x) = <ufunc 'entr'>

用于计算熵的基本函数。

\[\begin{split}\text{entr}(X)=\Begin{case}-x\log(X)&x>0\\0&x=0\\-\infty&\text{否则}\end{case}\end{split}\]
参数
xndarray

输入数组。

退货
resndarray

元素熵函数在给定点的取值 x

参见

kl_div, rel_entr

注意事项

这个函数是凹的。

0.15.0 新版功能.