jax.scipy.special.rel_entr

Contents

jax.scipy.special.rel_entr#

jax.scipy.special.rel_entr(p, q)[source]#

Elementwise function for computing relative entropy.

LAX-backend implementation of scipy.special.rel_entr().

Original docstring below.

\[\begin{split}\mathrm{rel\_entr}(x, y) = \begin{cases} x \log(x / y) & x > 0, y > 0 \\ 0 & x = 0, y \ge 0 \\ \infty & \text{otherwise} \end{cases}\end{split}\]
Returns:

Relative entropy of the inputs

Return type:

scalar or ndarray

References

Parameters: