def sample(self):
     u = tf.random_uniform(tf.shape(self.logits))
     return U.softmax(self.logits - tf.log(-tf.log(u)), axis=-1)  # softmax
예제 #2
0
 def sample(self):
     u = tf.random.uniform(tf.shape(input=self.logits))
     return U.softmax(self.logits - tf.math.log(-tf.math.log(u)), axis=-1)
 def mode(self):
     return U.softmax(self.logits, axis=-1)
예제 #4
0
 def sample(self):
     u = tf.random_uniform(tf.shape(self.logits))
     rand_logits = self.logits - tf.log(-tf.log(u))
     # return rand_logits
     return U.softmax(rand_logits, axis=-1)