Commit 21d0583f authored by Anthony Larcher's avatar Anthony Larcher
Browse files

debug score norm

parent d108c85f
......@@ -111,6 +111,7 @@ from .iv_scoring import cosine_scoring
from .iv_scoring import mahalanobis_scoring
from .iv_scoring import two_covariance_scoring
from .iv_scoring import PLDA_scoring
from .iv_scoring import fast_PLDA_scoring
from .gmm_scoring import gmm_scoring
......
......@@ -52,8 +52,9 @@ def znorm(enrol_test_scores, enrol_imp_scores, sym=False):
:return:
"""
# Align enrol_test_scores.modelset and enrol_imp_scores.modelset
enrol_imp_scores.filter(enrol_test_scores.modelset, enrol_imp_scores.segset, keep=True)
enrol_test_scores.sort()
#enrol_imp_scores.filter(enrol_test_scores.modelset, enrol_imp_scores.segset, keep=True)
scores_znorm = copy.deepcopy(enrol_test_scores)
scores_znorm.sort()
enrol_imp_scores.sort()
# Compute the new enrol_test_scores normalized scores
......@@ -64,9 +65,9 @@ def znorm(enrol_test_scores, enrol_imp_scores, sym=False):
else:
mean_per_model = enrol_imp_scores.scoremat.mean(1)
std_per_model = enrol_imp_scores.scoremat.std(1)
enrol_test_scores.scoremat = (enrol_test_scores.scoremat - mean_per_model) / std_per_model
scores_znorm.scoremat = (scores_znorm.scoremat - mean_per_model) / std_per_model
return enrol_test_scores
return scores_znorm
def tnorm(enrol_test_scores, imp_test_scores):
......@@ -77,16 +78,17 @@ def tnorm(enrol_test_scores, imp_test_scores):
:return:
"""
# Align enrol_test_scores.segset and imp_test_scores.segset
imp_test_scores.filter(imp_test_scores.modelset, enrol_test_scores.segset, keep=True)
enrol_test_scores.sort()
#imp_test_scores.filter(imp_test_scores.modelset, enrol_test_scores.segset, keep=True)
scores_tnorm = copy.deepcopy(enrol_test_scores)
scores_tnorm.sort()
imp_test_scores.sort()
# Compute the new enrol_test_scores normalized scores
mean_per_segment = imp_test_scores.scoremat.mean(0)
std_per_segment = imp_test_scores.scoremat.std(0)
enrol_test_scores.scoremat = (enrol_test_scores.scoremat - mean_per_segment) / std_per_segment
scores_tnorm.scoremat = (scores_tnorm.scoremat - mean_per_segment) / std_per_segment
return enrol_test_scores
return scores_tnorm
def ztnorm(enrol_test_scores, enrol_imp_scores, imp_test_scores, imp_imp_scores):
......
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