Skip to content
Snippets Groups Projects
Commit dfb95775 authored by Yannick DAYER's avatar Yannick DAYER
Browse files

Fix the step count of train and set seed correctly

parent ab1608e8
Branches
Tags
1 merge request!27Fix: hdf5 v3 not supported
Pipeline #58538 failed
...@@ -305,6 +305,7 @@ class GMM(BioAlgorithm, BaseEstimator): ...@@ -305,6 +305,7 @@ class GMM(BioAlgorithm, BaseEstimator):
max_iter=self.kmeans_training_iterations, max_iter=self.kmeans_training_iterations,
init_method="k-means||", init_method="k-means||",
init_max_iter=5, init_max_iter=5,
random_state=self.init_seed,
), ),
) )
......
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -28,12 +28,12 @@ import bob.bio.gmm ...@@ -28,12 +28,12 @@ import bob.bio.gmm
from bob.bio.base.test import utils from bob.bio.base.test import utils
from bob.bio.gmm.algorithm import GMM from bob.bio.gmm.algorithm import GMM
from bob.learn.em.mixture import GMMMachine from bob.learn.em import GMMMachine
from bob.learn.em.mixture import GMMStats from bob.learn.em import GMMStats
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
regenerate_refs = False regenerate_refs = True
seed_value = 5489 seed_value = 5489
...@@ -57,8 +57,8 @@ def test_training(): ...@@ -57,8 +57,8 @@ def test_training():
# Set a small training iteration count # Set a small training iteration count
gmm1 = GMM( gmm1 = GMM(
number_of_gaussians=2, number_of_gaussians=2,
kmeans_training_iterations=1, kmeans_training_iterations=5,
ubm_training_iterations=1, ubm_training_iterations=5,
init_seed=seed_value, init_seed=seed_value,
) )
train_data = utils.random_training_set( train_data = utils.random_training_set(
...@@ -155,7 +155,7 @@ def test_score(): ...@@ -155,7 +155,7 @@ def test_score():
) )
probe_data = utils.random_array((20, 45), -5.0, 5.0, seed=seed_value) probe_data = utils.random_array((20, 45), -5.0, 5.0, seed=seed_value)
reference_score = 0.593373 reference_score = 0.707260
numpy.testing.assert_almost_equal( numpy.testing.assert_almost_equal(
gmm1.score(biometric_reference, probe), reference_score, decimal=5 gmm1.score(biometric_reference, probe), reference_score, decimal=5
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment