Changed test function

parent 4bf5f3c5
Pipeline #39208 failed with stage
in 8 minutes and 42 seconds
......@@ -4,7 +4,6 @@
from bob.pipelines.utils import assert_picklable
from bob.learn.em import GMMMachine, ISVBase
from .test_em import equals
import numpy
import pickle
......@@ -14,9 +13,9 @@ def test_gmm_machine():
gmm_machine.means = numpy.arange(9).reshape(3,3).astype("float")
gmm_machine_after_pickle = pickle.loads(pickle.dumps(gmm_machine))
assert equals(gmm_machine_after_pickle.means, gmm_machine_after_pickle.means, 10e-3)
assert equals(gmm_machine_after_pickle.variances, gmm_machine_after_pickle.variances, 10e-3)
assert equals(gmm_machine_after_pickle.weights, gmm_machine_after_pickle.weights, 10e-3)
assert numpy.allclose(gmm_machine_after_pickle.means, gmm_machine_after_pickle.means, 10e-3)
assert numpy.allclose(gmm_machine_after_pickle.variances, gmm_machine_after_pickle.variances, 10e-3)
assert numpy.allclose(gmm_machine_after_pickle.weights, gmm_machine_after_pickle.weights, 10e-3)
def test_isv():
......@@ -28,5 +27,5 @@ def test_isv():
isv_base_after_pickle = pickle.loads(pickle.dumps(isv_base))
assert equals(isv_base.u, isv_base_after_pickle.u, 10e-3)
assert equals(isv_base.d, isv_base_after_pickle.d, 10e-3)
\ No newline at end of file
assert numpy.allclose(isv_base.u, isv_base_after_pickle.u, 10e-3)
assert numpy.allclose(isv_base.d, isv_base_after_pickle.d, 10e-3)
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment