def entropy(self): return tf.reduce_sum(bernoulli.entropy(self.p))
def _test_entropy(p): val_true = stats.bernoulli.entropy(p) _assert_eq(bernoulli.entropy(p), val_true) _assert_eq(bernoulli.entropy(tf.constant(p)), val_true) _assert_eq(bernoulli.entropy(tf.constant([p])), val_true)
def entropy(self): return tf.reduce_sum(bernoulli.entropy(self.p))
def _test(self, p): val_true = stats.bernoulli.entropy(p) self.assertAllClose(bernoulli.entropy(p).eval(), val_true) self.assertAllClose(bernoulli.entropy(tf.constant(p)).eval(), val_true)
def _test(self, p): val_true = stats.bernoulli.entropy(p) self.assertAllClose(bernoulli.entropy(p).eval(), val_true) self.assertAllClose(bernoulli.entropy(tf.constant(p)).eval(), val_true)
def _test_entropy(p): val_true = stats.bernoulli.entropy(p) _assert_eq(bernoulli.entropy(p), val_true) _assert_eq(bernoulli.entropy(tf.constant(p)), val_true) _assert_eq(bernoulli.entropy(tf.constant([p])), val_true)