How to get entropy from normal distribution? #15284
-
Hi, So now I'm wondering how could I get entropy of normal distribution? Anyone got an idea? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
JAX doesn't have any built-in entropy function, but fortunately the formula for the normal distribution entropy is pretty straightforward to define yourself: import jax.numpy as jnp
def normal_entropy(sigma):
return 0.5 * (jnp.log(2 * jnp.pi * sigma ** 2) + 1) |
Beta Was this translation helpful? Give feedback.
-
You could also use TFP: import tensorflow_probability.substrates.jax as tfp
tfp.distributions.Normal(loc=0., scale=1.).entropy() |
Beta Was this translation helpful? Give feedback.
JAX doesn't have any built-in entropy function, but fortunately the formula for the normal distribution entropy is pretty straightforward to define yourself: