Esempio n. 1
0
 def _upper_tail(self, tail_mass):
     tail = helpers.estimate_tails(
         self._logits_cumulative, tf.math.log(2 / tail_mass - 1),
         tf.constant([self.batch_shape.num_elements(), 1, 1], tf.int32),
         self.dtype)
     return tf.reshape(tail, self.batch_shape_tensor())
Esempio n. 2
0
 def _upper_tail(self, tail_mass):
     logits = -tf.math.log(tail_mass / 2 / (1. - tail_mass / 2))
     return helpers.estimate_tails(self._logits_cumulative, logits,
                                   self.batch_shape_tensor(), self.dtype)
Esempio n. 3
0
 def _quantization_offset(self):
   return helpers.estimate_tails(
       self._logits_cumulative, 0., self.batch_shape_tensor(), self.dtype)