[rllib] Entropy calculation for diag gaussian missing 0.5 term (#2968)

See: https://en.wikipedia.org/wiki/Multivariate_normal_distribution#Entropy
This commit is contained in:
Eric Liang 2018-09-29 22:57:47 -07:00 committed by Richard Liaw
parent b3f0dcf20b
commit cb56f39070

View file

@ -125,7 +125,7 @@ class DiagGaussian(ActionDistribution):
def entropy(self):
return tf.reduce_sum(
self.log_std + .5 * np.log(2.0 * np.pi * np.e),
.5 * self.log_std + .5 * np.log(2.0 * np.pi * np.e),
reduction_indices=[1])
def sample(self):