Esempio n. 1
0
 def _log_cdf(self, x):
     loc = tf.convert_to_tensor(self.loc)
     scale = tf.convert_to_tensor(self.scale)
     safe_x = self._get_safe_input(x, loc=loc, scale=scale)
     log_cdf = np.log(2 / np.pi) + tf.math.log(
         tf.atan((safe_x - loc) / scale))
     return tf.where(x < loc,
                     dtype_util.as_numpy_dtype(self.dtype)(-np.inf),
                     log_cdf)
Esempio n. 2
0
 def _log_cdf(self, x):
     loc = tf.convert_to_tensor(self.loc)
     scale = tf.convert_to_tensor(self.scale)
     with tf.control_dependencies(self._maybe_assert_valid_sample(x, loc)):
         safe_x = self._get_safe_input(x, loc=loc, scale=scale)
         log_cdf = np.log(2 / np.pi) + tf.math.log(
             tf.atan((safe_x - loc) / scale))
         return tf.where(x < loc,
                         dtype_util.as_numpy_dtype(self.dtype)(-np.inf),
                         log_cdf)
Esempio n. 3
0
 def _log_cdf(self, x):
   return tf.math.log1p(2 / np.pi * tf.atan(self._z(x))) - np.log(2)
Esempio n. 4
0
 def _cdf(self, x):
   return tf.atan(self._z(x)) / np.pi + 0.5
Esempio n. 5
0
 def _log_cdf(self, x):
     return self._extend_support_with_default_value(
         x,
         lambda x: np.log(2 / np.pi) + tf.math.log(tf.atan(self._z(x))),
         default_value=-np.inf)
Esempio n. 6
0
def _log_cauchy_cdf(z):
    return tf.math.log1p(2 / np.pi * tf.atan(z)) - np.log(2)
Esempio n. 7
0
def _cauchy_cdf(z):
    return tf.atan(z) / np.pi + 0.5