def gaussian_entropy(sigma):
"""Get the entropy of a multivariate Gaussian distribution with
ALL DIMENSIONS INDEPENDENT.
C.f. eq.(8.7) of [here](http://www.biopsychology.org/norwich/isp/\
chap8.pdf).
NOTE:
Gaussian entropy is independent of its center `mu`.
Args:
sigma:
Tensor of shape `[None]`.
Returns:
Scalar.
"""
n_dims = np.prod(sigma.get_shape().as_list())
return 0.5 * n_dims * tf.log(2. * np.pi * np.e) \
+ tf.reduce_sum(tf.log(sigma))
评论列表
文章目录