Beispiel #1
0
 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())
Beispiel #2
0
 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())