def _test(loc=0, scale=1):
    val_true = uniform_entropy_vec(loc, scale)
    _assert_eq(uniform.entropy(loc, scale), val_true)
    _assert_eq(uniform.entropy(tf.constant(loc), tf.constant(scale)), val_true)
    _assert_eq(uniform.entropy(tf.constant([loc]), tf.constant(scale)), val_true)
    _assert_eq(uniform.entropy(tf.constant(loc), tf.constant([scale])), val_true)
    _assert_eq(uniform.entropy(tf.constant([loc]), tf.constant([scale])), val_true)
def _test_entropy(loc=0, scale=1):
    val_true = uniform_entropy_vec(loc, scale)
    _assert_eq(uniform.entropy(loc, scale), val_true)
    _assert_eq(uniform.entropy(tf.constant(loc), tf.constant(scale)), val_true)
    _assert_eq(uniform.entropy(tf.constant([loc]), tf.constant(scale)), val_true)
    _assert_eq(uniform.entropy(tf.constant(loc), tf.constant([scale])), val_true)
    _assert_eq(uniform.entropy(tf.constant([loc]), tf.constant([scale])), val_true)
Beispiel #3
0
 def _test(self, a, b):
     val_true = uniform_entropy_vec(a, b - a)
     with self.test_session():
         self.assertAllClose(uniform.entropy(a, b).eval(), val_true)
         self.assertAllClose(
             uniform.entropy(tf.constant(a), tf.constant(b)).eval(),
             val_true)
Beispiel #4
0
 def _test(self, loc=0, scale=1):
     val_true = uniform_entropy_vec(loc, scale)
     with self.test_session():
         self.assertAllClose(uniform.entropy(loc, scale).eval(), val_true)
         self.assertAllClose(uniform.entropy(tf.constant(loc), tf.constant(scale)).eval(), val_true)
 def _test(self, a, b):
     val_true = uniform_entropy_vec(a, b - a)
     with self.test_session():
         self.assertAllClose(uniform.entropy(a=a, b=b).eval(), val_true)
 def _test(self, a, b):
   val_true = uniform_entropy_vec(a, b - a)
   with self.test_session():
     self.assertAllClose(uniform.entropy(a=a, b=b).eval(), val_true)