Пример #1
0
 def _test(self, x, df, mu, sigma):
   xtf = tf.constant(x)
   val_true = stats.t.logpdf(x, df, mu, sigma)
   with self.test_session():
     self.assertAllClose(t.logpdf(xtf, df, mu, sigma).eval(), val_true)
     self.assertAllClose(t.logpdf(xtf, df, tf.constant(mu),
                         tf.constant(sigma)).eval(), val_true)
Пример #2
0
def _test(x, df, loc=0, scale=1):
    xtf = tf.constant(x)
    val_true = stats.t.logpdf(x, df, loc, scale)
    _assert_eq(t.logpdf(xtf, df, loc, scale), val_true)
    _assert_eq(t.logpdf(xtf, df, tf.constant(loc), tf.constant(scale)), val_true)
    _assert_eq(t.logpdf(xtf, df, tf.constant([loc]), tf.constant(scale)), val_true)
    _assert_eq(t.logpdf(xtf, df, tf.constant(loc), tf.constant([scale])), val_true)
    _assert_eq(t.logpdf(xtf, df, tf.constant([loc]), tf.constant([scale])), val_true)
Пример #3
0
 def _test(self, x, df, loc=0, scale=1):
     xtf = tf.constant(x)
     val_true = stats.t.logpdf(x, df, loc, scale)
     with self.test_session():
         self.assertAllClose(t.logpdf(xtf, df, loc, scale).eval(), val_true)
         self.assertAllClose(
             t.logpdf(xtf, df, tf.constant(loc), tf.constant(scale)).eval(),
             val_true)
Пример #4
0
def _test(x, df, loc=0, scale=1):
    xtf = tf.constant(x)
    val_true = stats.t.logpdf(x, df, loc, scale)
    _assert_eq(t.logpdf(xtf, df, loc, scale), val_true)
    _assert_eq(t.logpdf(xtf, df, tf.constant(loc), tf.constant(scale)),
               val_true)
    _assert_eq(t.logpdf(xtf, df, tf.constant([loc]), tf.constant(scale)),
               val_true)
    _assert_eq(t.logpdf(xtf, df, tf.constant(loc), tf.constant([scale])),
               val_true)
    _assert_eq(t.logpdf(xtf, df, tf.constant([loc]), tf.constant([scale])),
               val_true)
Пример #5
0
 def _test(self, x, df, mu, sigma):
     val_true = stats.t.logpdf(x, df, mu, sigma)
     with self.test_session():
         self.assertAllClose(t.logpdf(x, df=df, mu=mu, sigma=sigma).eval(), val_true)
Пример #6
0
 def _test(self, x, df, mu, sigma):
   val_true = stats.t.logpdf(x, df, mu, sigma)
   with self.test_session():
     self.assertAllClose(t.logpdf(x, df=df, mu=mu, sigma=sigma).eval(),
                         val_true)
Пример #7
0
 def _test(self, x, df, loc=0, scale=1):
     xtf = tf.constant(x)
     val_true = stats.t.logpdf(x, df, loc, scale)
     with self.test_session():
         self.assertAllClose(t.logpdf(xtf, df, loc, scale).eval(), val_true)
         self.assertAllClose(t.logpdf(xtf, df, tf.constant(loc), tf.constant(scale)).eval(), val_true)