I would use ```numpy.testing.assert_allclose``` instead of ```numpy.testing.assert_almost_equal``` as the latter one is discouraged by the numpy documentation. Moreover, by playing with the relative tolerance you can get a variable precision depending on the value of the probabilities. What do you think?