a3fe8bdf1c484e390dfe3947cc395372c0187589,tensorforce/core/distributions/gaussian.py,Gaussian,tf_entropy,#Gaussian#Any#,110
Before Change
def tf_entropy(self, distr_params):
_, _, log_stddev = distr_params
return log_stddev + 0.5 * log(2.0 * pi * e)
def tf_kl_divergence(self, distr_params1, distr_params2):
mean1, stddev1, log_stddev1 = distr_params1
mean2, stddev2, log_stddev2 = distr_params2
After Change
def tf_entropy(self, parameters):
_, _, log_stddev = parameters
half = tf.constant(value=0.5, dtype=util.tf_dtype(dtype="float"))
two = tf.constant(value=2.0, dtype=util.tf_dtype(dtype="float"))
e_const = tf.constant(value=e, dtype=util.tf_dtype(dtype="float"))
pi_const = tf.constant(value=pi, dtype=util.tf_dtype(dtype="float"))
return log_stddev + half * tf.math.log(x=(two * pi_const * e_const))
def tf_kl_divergence(self, parameters1, parameters2):
mean1, stddev1, log_stddev1 = parameters1
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
Instances
Project Name: reinforceio/tensorforce
Commit Name: a3fe8bdf1c484e390dfe3947cc395372c0187589
Time: 2019-02-06
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/distributions/gaussian.py
Class Name: Gaussian
Method Name: tf_entropy
Project Name: reinforceio/tensorforce
Commit Name: a3fe8bdf1c484e390dfe3947cc395372c0187589
Time: 2019-02-06
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/distributions/gaussian.py
Class Name: Gaussian
Method Name: tf_log_probability
Project Name: reinforceio/tensorforce
Commit Name: a3fe8bdf1c484e390dfe3947cc395372c0187589
Time: 2019-02-06
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/distributions/gaussian.py
Class Name: Gaussian
Method Name: tf_entropy
Project Name: reinforceio/tensorforce
Commit Name: a3fe8bdf1c484e390dfe3947cc395372c0187589
Time: 2019-02-06
Author: alexkuhnle@t-online.de
File Name: tensorforce/core/distributions/beta.py
Class Name: Beta
Method Name: tf_parametrize