Skip to content
Snippets Groups Projects
Commit ae031342 authored by Elie KHOURY's avatar Elie KHOURY
Browse files

fix a bug in GMM with regular scoring

parent 6067f86e
No related branches found
No related tags found
No related merge requests found
......@@ -253,6 +253,7 @@ class GMMRegular (GMM):
def train_enroller(self, train_features, enroller_file):
"""Computes the Universal Background Model from the training ("world") data"""
train_features = [feature for client in train_features for feature in client]
return self.train_projector(train_features, enroller_file)
......
import bob.bio.gmm
algorithm = bob.bio.gmm.algorithm.IVector(
# IVector parameters
subspace_dimension_of_t = 100,
update_sigma = True,
tv_training_iterations = 25, # Number of EM iterations for the TV training
# GMM parameters
number_of_gaussians = 256,
use_plda = True,
plda_dim_F = 50,
plda_dim_G = 50,
plda_training_iterations = 200,
)
......@@ -148,8 +148,8 @@ def test_gmm_regular():
train_data = utils.random_training_set((100,45), count=5, minimum=-5., maximum=5.)
reference_file = pkg_resources.resource_filename('bob.bio.gmm.test', 'data/gmm_projector.hdf5')
try:
# train the projector
gmm2.train_enroller(train_data, temp_file)
# train the enroler
gmm2.train_enroller([train_data], temp_file)
assert os.path.exists(temp_file)
......@@ -331,7 +331,7 @@ def test_jfa():
def test_ivector_cosine():
temp_file = bob.io.base.test_utils.temporary_filename()
ivec1 = bob.bio.base.load_resource("ivector", "algorithm")
ivec1 = bob.bio.base.load_resource("ivector-cosine", "algorithm")
assert isinstance(ivec1, bob.bio.gmm.algorithm.IVector)
assert isinstance(ivec1, bob.bio.gmm.algorithm.GMM)
assert isinstance(ivec1, bob.bio.base.algorithm.Algorithm)
......@@ -396,7 +396,7 @@ def test_ivector_cosine():
def test_ivector_plda():
temp_file = bob.io.base.test_utils.temporary_filename()
ivec1 = bob.bio.base.load_resource("ivector", "algorithm")
ivec1 = bob.bio.base.load_resource("ivector-plda", "algorithm")
ivec1.use_plda = True
# create smaller IVector object
......@@ -458,7 +458,7 @@ def test_ivector_plda():
def test_ivector_lda_wccn_plda():
temp_file = bob.io.base.test_utils.temporary_filename()
ivec1 = bob.bio.base.load_resource("ivector", "algorithm")
ivec1 = bob.bio.base.load_resource("ivector-lda-wccn-plda", "algorithm")
ivec1.use_lda = True
ivec1.use_wccn = True
ivec1.use_plda = True
......
......@@ -124,6 +124,7 @@ setup(
'jfa = bob.bio.gmm.config.algorithm.jfa:algorithm',
'isv = bob.bio.gmm.config.algorithm.isv:algorithm',
'ivector-cosine = bob.bio.gmm.config.algorithm.ivector_cosine:algorithm',
'ivector-plda = bob.bio.gmm.config.algorithm.ivector_plda:algorithm',
'ivector-lda-wccn-plda = bob.bio.gmm.config.algorithm.ivector_lda_wccn_plda:algorithm',
],
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment