Пример #1
0
 def testBijector(self):
     with self.test_session():
         bijector = _Identity(_ShapeUtil(batch_ndims=1, event_ndims=1))
         self.assertEqual(bijector.name, 'Identity')
         x = [[[0.], [1]]]
         self.assertAllEqual(bijector.forward(x).eval(), x)
         self.assertAllEqual(bijector.inverse(x).eval(), x)
         self.assertAllEqual(
             bijector.inverse_log_det_jacobian(x).eval(), [[0., 0]])
         rev, jac = bijector.inverse_and_inverse_log_det_jacobian(x)
         self.assertAllEqual(rev.eval(), x)
         self.assertAllEqual(jac.eval(), [[0., 0]])
Пример #2
0
 def testBijector(self):
   with self.test_session():
     bijector = _Identity()
     self.assertEqual("Identity", bijector.name)
     x = [[[0.],
           [1.]]]
     self.assertAllEqual(x, bijector.forward(x).eval())
     self.assertAllEqual(x, bijector.inverse(x).eval())
     self.assertAllEqual(0., bijector.inverse_log_det_jacobian(x).eval())
     rev, jac = bijector.inverse_and_inverse_log_det_jacobian(x)
     self.assertAllEqual(x, rev.eval())
     self.assertAllEqual(0., jac.eval())
Пример #3
0
 def testBijector(self):
     with self.test_session():
         bijector = _Identity()
         self.assertEqual("Identity", bijector.name)
         x = [[[0.], [1.]]]
         self.assertAllEqual(x, bijector.forward(x).eval())
         self.assertAllEqual(x, bijector.inverse(x).eval())
         self.assertAllEqual(0.,
                             bijector.inverse_log_det_jacobian(x).eval())
         rev, jac = bijector.inverse_and_inverse_log_det_jacobian(x)
         self.assertAllEqual(x, rev.eval())
         self.assertAllEqual(0., jac.eval())
Пример #4
0
 def testBijector(self):
   with self.test_session():
     bijector = _Identity(_ShapeUtil(batch_ndims=1, event_ndims=1))
     self.assertEqual(bijector.name, 'Identity')
     x = [[[0.], [1]]]
     self.assertAllEqual(bijector.forward(x).eval(), x)
     self.assertAllEqual(bijector.inverse(x).eval(), x)
     self.assertAllEqual(bijector.inverse_log_det_jacobian(x).eval(),
                         [[0., 0]])
     rev, jac = bijector.inverse_and_inverse_log_det_jacobian(x)
     self.assertAllEqual(rev.eval(), x)
     self.assertAllEqual(jac.eval(), [[0., 0]])