Пример #1
0
 def plus(self, a, b):
     return logAdd(a, b)
Пример #2
0
 def test_logAdd(self, numPoints=200):
     for pointIndex in range(numPoints):
         a = randLogProb()
         b = randLogProb()
         r = mathhelp.logAdd(a, b)
         assert_allclose(np.exp(r), np.exp(a) + np.exp(b))
Пример #3
0
 def test_logAdd(self, numPoints = 200):
     for pointIndex in range(numPoints):
         a = randLogProb()
         b = randLogProb()
         r = mathhelp.logAdd(a, b)
         assert_allclose(np.exp(r), np.exp(a) + np.exp(b))