mars.tensor.special.entr#

mars.tensor.special.entr(x, out=None, where=None, **kwargs)[source]#

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}\]
Parameters

x (Tensor) – Input tensor.

Returns

res – The value of the elementwise entropy function at the given points x.

Return type

Tensor

See also

kl_div, rel_entr

Notes

This function is concave.