예제 #1
0
파일: test_factor.py 프로젝트: dirko/pyugm
 def test_get_potential_slice(self):
     a = DiscreteFactor([(4, 2), (8, 3)], data=np.array(range(6)).reshape(2, 3))
     b = a.get_potential([(8, 0), (9, 1), (2, 4)])
     self.assertIsNone(assert_array_almost_equal(b, np.array([0, 3])))
예제 #2
0
파일: test_factor.py 프로젝트: dirko/pyugm
 def test_get_potential_single(self):
     a = DiscreteFactor([(4, 2), (8, 3)], data=np.array(range(6)).reshape(2, 3))
     b = a.get_potential([(8, 0), (4, 1), (2, 4)])
     print b
     self.assertAlmostEqual(b, 3)