diff --git a/bob/bio/gmm/algorithm/GMM.py b/bob/bio/gmm/algorithm/GMM.py index 3d9d23eadbe0bd8c4902db8b973a880ecc44a692..bc6c1434ba411571de4d95f643ba944dc635d189 100644 --- a/bob/bio/gmm/algorithm/GMM.py +++ b/bob/bio/gmm/algorithm/GMM.py @@ -305,6 +305,7 @@ class GMM(BioAlgorithm, BaseEstimator): max_iter=self.kmeans_training_iterations, init_method="k-means||", init_max_iter=5, + random_state=self.init_seed, ), ) diff --git a/bob/bio/gmm/test/data/gmm_enrolled.hdf5 b/bob/bio/gmm/test/data/gmm_enrolled.hdf5 index 6466ed0a3fc524a6ab698f09540aa908f5108c22..4b48c0fa3c6376c2e5c41aa164dac481c847e380 100644 Binary files a/bob/bio/gmm/test/data/gmm_enrolled.hdf5 and b/bob/bio/gmm/test/data/gmm_enrolled.hdf5 differ diff --git a/bob/bio/gmm/test/data/gmm_projected.hdf5 b/bob/bio/gmm/test/data/gmm_projected.hdf5 index fc5e0a7c0b8f41d3b7d9a03d07c8e277f8bb5386..1bdbba5769c5a7195efe81d6b0b14685ef980097 100644 Binary files a/bob/bio/gmm/test/data/gmm_projected.hdf5 and b/bob/bio/gmm/test/data/gmm_projected.hdf5 differ diff --git a/bob/bio/gmm/test/data/gmm_ubm.hdf5 b/bob/bio/gmm/test/data/gmm_ubm.hdf5 index 6a8abe718f958351135e5992621a733016127ccc..780baa0277bd2d7cf68ab048c7df69900fa6b875 100644 Binary files a/bob/bio/gmm/test/data/gmm_ubm.hdf5 and b/bob/bio/gmm/test/data/gmm_ubm.hdf5 differ diff --git a/bob/bio/gmm/test/test_gmm.py b/bob/bio/gmm/test/test_gmm.py index e2434f0893f006453f65046a8999fa7d95ebabba..ea7b6a4c9cc21853924d5eb8fbabb6d8f70d3da9 100644 --- a/bob/bio/gmm/test/test_gmm.py +++ b/bob/bio/gmm/test/test_gmm.py @@ -28,8 +28,8 @@ import bob.bio.gmm from bob.bio.base.test import utils from bob.bio.gmm.algorithm import GMM -from bob.learn.em.mixture import GMMMachine -from bob.learn.em.mixture import GMMStats +from bob.learn.em.mixture.gmm import GMMMachine +from bob.learn.em.mixture.gmm import GMMStats logger = logging.getLogger(__name__) @@ -57,8 +57,8 @@ def test_training(): # Set a small training iteration count gmm1 = GMM( number_of_gaussians=2, - kmeans_training_iterations=1, - ubm_training_iterations=1, + kmeans_training_iterations=5, + ubm_training_iterations=5, init_seed=seed_value, ) train_data = utils.random_training_set( @@ -95,7 +95,7 @@ def test_projector(): ) # Generate and project random feature - feature = utils.random_array((20, 45), -5.0, 5.0, seed=84) + feature = utils.random_array((20, 45), -5.0, 5.0, seed=seed_value) projected = gmm1.project(feature) assert isinstance(projected, bob.learn.em.mixture.GMMStats) @@ -120,7 +120,7 @@ def test_enroll(): ) gmm1.ubm = ubm # Enroll the biometric reference from random features - enroll = utils.random_training_set((20, 45), 5, -5.0, 5.0, seed=21) + enroll = utils.random_training_set((20, 45), 5, -5.0, 5.0, seed=seed_value) biometric_reference = gmm1.enroll(enroll) assert not biometric_reference.is_similar_to(biometric_reference.ubm) assert isinstance(biometric_reference, GMMMachine) @@ -153,9 +153,9 @@ def test_score(): probe = GMMStats.from_hdf5( pkg_resources.resource_filename("bob.bio.gmm.test", "data/gmm_projected.hdf5") ) - probe_data = utils.random_array((20, 45), -5.0, 5.0, seed=84) + probe_data = utils.random_array((20, 45), -5.0, 5.0, seed=seed_value) - reference_score = -0.098980 + reference_score = 0.601025 numpy.testing.assert_almost_equal( gmm1.score(biometric_reference, probe), reference_score, decimal=5