jax.scipy.special.entr

jax.scipy.special.entr(x)[source]

Elementwise function for computing entropy.

LAX-backend implementation of entr(). Original docstring below.

entr(x, /, out=None, *, where=True, casting=’same_kind’, order=’K’, dtype=None, subok=True[, signature, extobj])

entr(x)

\[\begin{split}\text{entr}(x) = \begin{cases} - x \log(x) & x > 0 \\ 0 & x = 0 \\ -\infty & \text{otherwise} \end{cases}\end{split}\]
Parameters

x (ndarray) – Input array.

Returns

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

Return type

ndarray

See also

kl_div(), rel_entr()

Notes

This function is concave.

New in version 0.15.0.