Exemplo n.º 1
0
 def get_expected_value(
     self,
     *inputs,
     **kwargs
 ):
     return tf.math.tanh(Gaussian.get_expected_value(
         self, *inputs, **kwargs))
Exemplo n.º 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)
Exemplo n.º 3
0
 def get_expected_value_of_prior(
     self,
     shape,
     **kwargs
 ):
     return tf.math.tanh(Gaussian.get_expected_value_of_prior(self, shape, **kwargs))
Exemplo n.º 4
0
 def sample_from_prior(
     self,
     shape,
     **kwargs
 ):
     return tf.math.tanh(Gaussian.sample_from_prior(self, shape, **kwargs))
Exemplo n.º 5
0
 def sample(
     self,
     *inputs,
     **kwargs
 ):
     return tf.math.tanh(Gaussian.sample(self, *inputs, **kwargs))
Exemplo n.º 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)