maxframe.tensor.special.entr#

maxframe.tensor.special.entr(x, out=None, where=None, **kwargs)[源代码]#

用于计算熵的逐元素函数。

\[\begin{split}\text{entr}(x) = \begin{cases} - x \log(x) & x > 0 \\ 0 & x = 0 \\ -\infty & \text{其他情况} \end{cases}\end{split}\]
参数:

x (Tensor) -- 输入张量。

返回:

res -- 在给定点 x 处逐元素熵函数的值。

返回类型:

Tensor

参见

kl_div, rel_entr

备注

该函数是凹函数。