iv_scoring¶
Copyright 2014-2019 Anthony Larcher and Sylvain Meignier
iv_scoring
provides methods to compare i-vectors
-
iv_scoring.
PLDA_scoring
(enroll, test, ndx, mu, F, G, Sigma, test_uncertainty=None, Vtrans=None, p_known=0.0, scaling_factor=1.0, full_model=False)[source]¶ Compute the PLDA scores between two sets of vectors. The list of trials to perform is given in an Ndx object. PLDA matrices have to be pre-computed. i-vectors are supposed to be whitened before.
Implements the approach described in [Lee13] including scoring for partially open-set identification
- Parameters
enroll – a StatServer in which stat1 are i-vectors
test – a StatServer in which stat1 are i-vectors
ndx – an Ndx object defining the list of trials to perform
mu – the mean vector of the PLDA gaussian
F – the between-class co-variance matrix of the PLDA
G – the within-class co-variance matrix of the PLDA
Sigma – the residual covariance matrix
p_known – probability of having a known speaker for open-set identification case (=1 for the verification task and =0 for the closed-set case)
scaling_factor – scaling factor to be multiplied by the sufficient statistics
full_model – boolean, set to True when using a complete PLDA model (including within class covariance matrix)
- Returns
a score object
-
iv_scoring.
PLDA_scoring_uncertainty
(enroll, test, ndx, mu, F, Sigma, p_known=0.0, scaling_factor=1.0, test_uncertainty=None, Vtrans=None, check_missing=True)[source]¶ - Parameters
enroll –
test –
ndx –
mu –
F –
Sigma –
p_known –
scaling_factor –
test_uncertainty –
Vtrans –
check_missing –
- Returns
-
iv_scoring.
cosine_scoring
(enroll, test, ndx, wccn=None, check_missing=True)[source]¶ Compute the cosine similarities between to sets of vectors. The list of trials to perform is given in an Ndx object.
- Parameters
enroll – a StatServer in which stat1 are i-vectors
test – a StatServer in which stat1 are i-vectors
ndx – an Ndx object defining the list of trials to perform
wccn – numpy.ndarray, if provided, the i-vectors are normalized by using a Within Class Covariance Matrix
check_missing – boolean, if True, check that all models and segments exist
- Returns
a score object
-
iv_scoring.
fast_PLDA_scoring
(enroll, test, ndx, mu, F, Sigma, test_uncertainty=None, Vtrans=None, p_known=0.0, scaling_factor=1.0, check_missing=True)[source]¶ Compute the PLDA scores between to sets of vectors. The list of trials to perform is given in an Ndx object. PLDA matrices have to be pre-computed. i-vectors are supposed to be whitened before.
- Parameters
enroll – a StatServer in which stat1 are i-vectors
test – a StatServer in which stat1 are i-vectors
ndx – an Ndx object defining the list of trials to perform
mu – the mean vector of the PLDA gaussian
F – the between-class co-variance matrix of the PLDA
Sigma – the residual covariance matrix
p_known – probability of having a known speaker for open-set identification case (=1 for the verification task and =0 for the closed-set case)
check_missing – boolean, if True, check that all models and segments exist
- Returns
a score object
-
iv_scoring.
full_PLDA_scoring
(enroll, test, ndx, mu, F, G, Sigma, p_known=0.0, scaling_factor=1.0, check_missing=True)[source]¶ Compute PLDA scoring
- Parameters
enroll – a StatServer in which stat1 are i-vectors
test – a StatServer in which stat1 are i-vectors
ndx – an Ndx object defining the list of trials to perform
mu – the mean vector of the PLDA gaussian
F – the between-class co-variance matrix of the PLDA
G – the within-class co-variance matrix of the PLDA
Sigma – the residual covariance matrix
p_known – probability of having a known speaker for open-set identification case (=1 for the verification task and =0 for the closed-set case)
check_missing – boolean, default is True, set to False not to check missing models
-
iv_scoring.
mahalanobis_scoring
(enroll, test, ndx, m, check_missing=True)[source]¶ Compute the mahalanobis distance between to sets of vectors. The list of trials to perform is given in an Ndx object.
- Parameters
enroll – a StatServer in which stat1 are i-vectors
test – a StatServer in which stat1 are i-vectors
ndx – an Ndx object defining the list of trials to perform
m – mahalanobis matrix as a ndarray
check_missing – boolean, default is True, set to False not to check missing models
- Returns
a score object
-
iv_scoring.
two_covariance_scoring
(enroll, test, ndx, W, B, check_missing=True)[source]¶ Compute the 2-covariance scores between to sets of vectors. The list of trials to perform is given in an Ndx object. Within and between class co-variance matrices have to be pre-computed.
- Parameters
enroll – a StatServer in which stat1 are i-vectors
test – a StatServer in which stat1 are i-vectors
ndx – an Ndx object defining the list of trials to perform
W – the within-class co-variance matrix to consider
B – the between-class co-variance matrix to consider
check_missing – boolean, default is True, set to False not to check missing models
- Returns
a score object