jax.scipy.special.rel_entr

Contents

jax.scipy.special.rel_entr#

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

The relative entropy function.

JAX implementation of scipy.special.rel_entr.

\[\begin{split} \mathrm{rel\_entr}(p, q) = \begin{cases} p\log(p/q) & p>0,q>0\\ 0 & p=0,q\ge 0\\ \infty & \mathrm{otherwise} \end{cases}\end{split}\]
Parameters:
  • p (jax.typing.ArrayLike) – arraylike, real-valued.

  • q (jax.typing.ArrayLike) – arraylike, real-valued.

Returns:

array of relative entropy values.

Return type:

Array