예제 #1
0
 def calc_loss(self, z_k: Tensor, log_q_k: Tensor,
               target_distribution: Distribution) -> Tensor:
     p = target_distribution.calc_prob_tf(z_k)
     log_p = tf.log(p + DELTA)
     loss = tf.reduce_mean(log_q_k - log_p)
     return loss
예제 #2
0
 def test_calc_prob_tf(self):
     with self.assertRaises(NotImplementedError):
         Distribution.calc_prob_tf(self.z_tf)