예제 #1
0
파일: gaussian.py 프로젝트: y-ok/PRML
 def test_map(self):
     g = Gaussian(mean=Gaussian(np.zeros(2), np.ones(2)), var=np.ones(2))
     g.map(np.array([[1., 0.], [0., 1.], [-1., 0.], [0., -1.]]))
     self.assertTrue((g.mean == 0).all())
     g1 = Gaussian(mean=Gaussian(np.zeros(2), np.ones(2)), var=np.ones(2))
     g1.bayes(np.array([[1., 0.], [0., 1.], [-1., 0.], [0., -1.]]))
     self.assertTrue((g.mean == g1.mean.mean).all())
예제 #2
0
파일: gaussian.py 프로젝트: y-ok/PRML
 def test_bayes(self):
     g = Gaussian(mean=Gaussian(np.zeros(2), np.ones(2)), var=np.ones(2))
     g.bayes(np.array([[1., 0.], [0., 1.], [-1., 0.], [0., -1.]]))
     self.assertTrue((g.mean.var == np.ones(2) * 0.2).all())