Example #1
0
 def get_expected_value(
     self,
     *inputs,
     **kwargs
 ):
     return tf.math.tanh(Gaussian.get_expected_value(
         self, *inputs, **kwargs))
Example #2
0
 def get_log_probs(
     self,
     x,
     *inputs,
     **kwargs
 ):
     x = tf.clip_by_value(x, -0.999, 0.999)
     correction = -1.0 * tf.reduce_sum(tf.math.log(1.0 - tf.math.square(x)), axis=-1)
     return correction + Gaussian.get_log_probs(
         self, tf.math.atanh(x), *inputs, **kwargs)
Example #3
0
 def get_expected_value_of_prior(
     self,
     shape,
     **kwargs
 ):
     return tf.math.tanh(Gaussian.get_expected_value_of_prior(self, shape, **kwargs))
Example #4
0
 def sample_from_prior(
     self,
     shape,
     **kwargs
 ):
     return tf.math.tanh(Gaussian.sample_from_prior(self, shape, **kwargs))
Example #5
0
 def sample(
     self,
     *inputs,
     **kwargs
 ):
     return tf.math.tanh(Gaussian.sample(self, *inputs, **kwargs))
Example #6
0
 def get_log_probs(self, x, *inputs, **kwargs):
     x = tf.maximum(x, 0.001)
     correction = -1.0 * tf.reduce_sum(x, axis=-1)
     return correction + Gaussian.get_log_probs(self, tf.math.log(x), *
                                                inputs, **kwargs)