コード例 #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)