mars.tensor.special.entr¶
- mars.tensor.special.entr(x, out=None, where=None, **kwargs)[源代码]¶
Elementwise function for computing entropy.
\[\begin{split}\text{entr}(x) = \begin{cases} - x \log(x) & x > 0 \\ 0 & x = 0 \\ -\infty & \text{otherwise} \end{cases}\end{split}\]- 参数
x (Tensor) – Input tensor.
- 返回
res – The value of the elementwise entropy function at the given points x.
- 返回类型
Tensor
参见
kl_div
,rel_entr
提示
This function is concave.