Commit 633a2554 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Changed references for the new pseudo random number generator

parent cb906338
Pipeline #18938 passed with stage
in 47 minutes and 47 seconds
This diff is collapsed.
This diff is collapsed.
......@@ -238,7 +238,7 @@ def test_isv():
# compare model with probe
probe = isv1.read_feature(pkg_resources.resource_filename('bob.bio.gmm.test', 'data/isv_projected.hdf5'))
reference_score = -0.00018454
reference_score = 0.02136783885580
assert abs(isv1.score(model, probe) - reference_score) < 1e-5, "The scores differ: %3.8f, %3.8f" % (isv1.score(model, probe), reference_score)
# assert abs(isv1.score_for_multiple_probes(model, [probe]*4) - reference_score) < 1e-5, isv1.score_for_multiple_probes(model, [probe, probe])
# TODO: Why is the score not identical for multiple copies of the same probe?
......@@ -387,7 +387,7 @@ def test_ivector_cosine():
# compare model with probe
probe = ivec1.read_feature(pkg_resources.resource_filename('bob.bio.gmm.test', 'data/ivector_projected.hdf5'))
reference_score = 0.06686013
reference_score = -0.00187151477
assert abs(ivec1.score(model, probe) - reference_score) < 1e-5, "The scores differ: %3.8f, %3.8f" % (ivec1.score(model, probe), reference_score)
# TODO: implement that
assert abs(ivec1.score_for_multiple_probes(model, [probe, probe]) - reference_score) < 1e-5
......@@ -425,7 +425,6 @@ def test_ivector_plda():
assert os.path.exists(temp_file)
if regenerate_refs: shutil.copy(temp_file, reference_file)
# check projection matrix
ivec1.load_projector(reference_file)
ivec2.load_projector(temp_file)
......@@ -445,13 +444,13 @@ def test_ivector_plda():
random_features = utils.random_training_set((20,45), count=5, minimum=-5., maximum=5.)
enroll_features = [ivec1.project(feature) for feature in random_features]
model = ivec1.enroll(enroll_features)
model = ivec1.enroll(enroll_features)
_compare(model, pkg_resources.resource_filename('bob.bio.gmm.test', 'data/ivector2_model.hdf5'), ivec1.write_model, ivec1.read_model)
# compare model with probe
probe = ivec1.read_feature(pkg_resources.resource_filename('bob.bio.gmm.test', 'data/ivector2_projected.hdf5'))
logger.info("%f" %ivec1.score(model, probe))
reference_score = 1.15277692
reference_score = 1.2187982243
assert abs(ivec1.score(model, probe) - reference_score) < 1e-5, "The scores differ: %3.8f, %3.8f" % (ivec1.score(model, probe), reference_score)
assert abs(ivec1.score_for_multiple_probes(model, [probe, probe]) - reference_score) < 1e-5
......@@ -510,11 +509,11 @@ def test_ivector_lda_wccn_plda():
# enroll model from random features
random_features = utils.random_training_set((20,45), count=5, minimum=-5., maximum=5.)
enroll_features = [ivec1.project(feature) for feature in random_features]
model = ivec1.enroll(enroll_features)
model = ivec1.enroll(enroll_features)
_compare(model, pkg_resources.resource_filename('bob.bio.gmm.test', 'data/ivector3_model.hdf5'), ivec1.write_model, ivec1.read_model)
# compare model with probe
probe = ivec1.read_feature(pkg_resources.resource_filename('bob.bio.gmm.test', 'data/ivector3_projected.hdf5'))
reference_score = 0.30489049
reference_score = 0.2954148598
assert abs(ivec1.score(model, probe) - reference_score) < 1e-5, "The scores differ: %3.8f, %3.8f" % (ivec1.score(model, probe), reference_score)
assert abs(ivec1.score_for_multiple_probes(model, [probe, probe]) - reference_score) < 1e-5
......@@ -28,6 +28,9 @@ def _verify(parameters, test_dir, sub_dir, ref_modifier="", score_modifier=('sco
# assert that the score file exists
score_files = [os.path.join(test_dir, sub_dir, 'Default', norm, '%s-dev%s'%score_modifier) for norm in ('nonorm', 'ztnorm')]
#import ipdb; ipdb.set_trace()
assert os.path.exists(score_files[0]), "Score file %s does not exist" % score_files[0]
assert os.path.exists(score_files[1]), "Score file %s does not exist" % score_files[1]
......
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