mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 20:22:39 +08:00
[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user