This section includes information for using the pure Python API of bob.learn.misc.
Computes the matrix of boolean D for the ZT-norm, which indicates where the client ids of the T-Norm models and Z-Norm samples match.
vect_a An (ordered) list of client_id corresponding to the T-Norm models vect_b An (ordered) list of client_id corresponding to the Z-Norm impostor samples
Bases: bob.learn.misc._old_library.EMTrainerLinear
This class implements the EM algorithm for a Linear Machine (Probabilistic PCA). See Section 12.2 of Bishop, “Pattern recognition and machine learning”, 2006
__init__( (object)self, (EMPCATrainer)trainer) -> None : Copy constructs an EMPCATrainer
Computes the current log likelihood given the hidden variable distribution (or the sufficient statistics)
Indicates whether the log likelihood should be computed during EM or not
Convergence threshold
Updates the hidden variable distribution (or the sufficient statistics) given the Machine parameters.
This method is called at the end of the EM algorithm
This method is called before the EM algorithm
Compares this EMPCATrainer with the ‘other’ one to be approximately the same.
Updates the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
The noise sigma2 of the probabilistic model
Trains a machine using data
Bases: Boost.Python.instance
The base python class for all EM-based trainers.
Raises an exception This class cannot be instantiated from Python
Returns the likelihood.
Convergence threshold
Update the hidden variable distribution (or the sufficient statistics) given the Machine parameters. Also, calculate the average output of the Machine given these parameters. Return the average output of the Machine across the dataset. The EM algorithm will terminate once the change in average_output is less than the convergence_threshold.
This method is called after the EM algorithm
This method is called before the EM algorithm
Update the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
Train a machine using data
Bases: Boost.Python.instance
The base python class for all EM-based trainers.
Raises an exception This class cannot be instantiated from Python
Computes the current log likelihood given the hidden variable distribution (or the sufficient statistics)
Indicates whether the log likelihood should be computed during EM or not
Convergence threshold
Updates the hidden variable distribution (or the sufficient statistics) given the Machine parameters.
This method is called at the end of the EM algorithm
This method is called before the EM algorithm
Updates the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
Trains a machine using data
Bases: Boost.Python.instance
The base python class for all EM-based trainers.
Raises an exception This class cannot be instantiated from Python
Returns the average min (square Euclidean) distance
Convergence threshold
Update the hidden variable distribution (or the sufficient statistics) given the Machine parameters. Also, calculate the average output of the Machine given these parameters. Return the average output of the Machine across the dataset. The EM algorithm will terminate once the change in average_output is less than the convergence_threshold.
This method is called after the EM algorithm
This method is called before the EM algorithm
Update the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
Train a machine using data
Bases: Boost.Python.instance
The base python class for all EM-based trainers.
Raises an exception This class cannot be instantiated from Python
Computes the current log likelihood given the hidden variable distribution (or the sufficient statistics)
Indicates whether the log likelihood should be computed during EM or not
Convergence threshold
Updates the hidden variable distribution (or the sufficient statistics) given the Machine parameters.
This method is called at the end of the EM algorithm
This method is called before the EM algorithm
Updates the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
Trains a machine using data
Bases: Boost.Python.instance
The base python class for all EM/PLDA-based trainers.
Raises an exception This class cannot be instantiated from Python
Updates the hidden variable distribution (or the sufficient statistics) given the Machine parameters.
This method is called at the end of the EM algorithm
This method is called before the EM algorithm
Updates the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
Trains a PLDABase using data (mu, F, G and sigma are learnt).
Bases: bob.learn.misc._old_library.MachineDoubleBase
This class implements a multivariate diagonal Gaussian distribution. See Section 2.3.9 of Bishop, “Pattern recognition and machine learning”, 2006
__init__( (object)arg1, (object)arg2) -> object
__init__( (object)self, (int)n_gaussians, (int)n_inputs) -> None
Accumulate the GMM statistics for this sample(s). Inputs are checked.
Accumulate the GMM statistics for this sample(s). Inputs are NOT checked.
The number of Gaussian components C
The feature dimensionality D
Executes the machine on the given 1D numpy array of float64, and returns the output.
Executes the machine on the given 1D numpy array of float64, and returns the output. NO CHECK is performed.
Compares this GMMMachine with the ‘other’ one to be approximately the same.
Load from a Configuration
Output the log likelihood of the sample, x, i.e. log(p(x|bob::learn::misc::GMMMachine)). Inputs are checked.
Output the log likelihood of the sample, x, i.e. log(p(x|bob::learn::misc::GMMMachine)). Inputs are NOT checked.
The mean supervector of the GMMMachine (concatenation of the mean vectors of each Gaussian of the GMMMachine
The means of the gaussians
Reset the input dimensionality, and the number of Gaussian components. Initialises the weights to uniform distribution.
Save to a Configuration
Set the variance flooring thresholds in each dimension to the same vector for all Gaussian components if the argument is a 1D numpy arrray, and equal for all Gaussian components and dimensions if the parameter is a scalar.
A tuple that represents the dimensionality of the GMMMachine (n_gaussians, n_inputs).
Get the specified Gaussian component. An exception is thrown if i is out of range.
The variance supervector of the GMMMachine (concatenation of the variance vectors of each Gaussian of the GMMMachine
The variance flooring thresholds for each Gaussian in each dimension
The (diagonal) variances of the Gaussians
The weights (also known as “mixing coefficients”)
Bases: Boost.Python.instance
A container for GMM statistics. With respect to Reynolds, “Speaker Verification Using Adapted Gaussian Mixture Models”, DSP, 2000: Eq (8) is n(i) Eq (9) is sumPx(i) / n(i) Eq (10) is sumPxx(i) / n(i)
__init__( (object)arg1, (object)arg2) -> object
__init__( (object)self, (int)n_gaussians, (int)n_inputs) -> None
Resets statistics to zero.
Compares this GMMStats with the ‘other’ one to be approximately the same.
Load from a Configuration
The accumulated log likelihood of all samples
For each Gaussian, the accumulated sum of responsibilities, i.e. the sum of P(gaussian_i|x)
Allocates space for the statistics and resets to zero.
Save to a Configuration
For each Gaussian, the accumulated sum of responsibility times the sample
For each Gaussian, the accumulated sum of responsibility times the sample squared
The accumulated number of samples
Bases: bob.learn.misc._old_library.EMTrainerGMM
This class implements the E-step of the expectation-maximisation algorithm for a GMM Machine. See Section 9.2.2 of Bishop, “Pattern recognition and machine learning”, 2006
Raises an exception This class cannot be instantiated from Python
Returns the likelihood.
Convergence threshold
Update the hidden variable distribution (or the sufficient statistics) given the Machine parameters. Also, calculate the average output of the Machine given these parameters. Return the average output of the Machine across the dataset. The EM algorithm will terminate once the change in average_output is less than the convergence_threshold.
This method is called after the EM algorithm
The internal GMM statistics. Useful to parallelize the E-step.
This method is called before the EM algorithm
Update the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
Train a machine using data
Bases: bob.learn.misc._old_library.MachineDoubleBase
This class implements a multivariate diagonal Gaussian distribution.
__init__( (object)self) -> None
__init__( (object)self, (int)n_inputs) -> None
__init__( (object)self, (Gaussian)other) -> None
Dimensionality of the input feature space
Executes the machine on the given 1D numpy array of float64, and returns the output.
Executes the machine on the given 1D numpy array of float64, and returns the output. NO CHECK is performed.
Compares this Gaussian with the ‘other’ one to be approximately the same.
Load from a Configuration
Output the log likelihood of the sample, x. The input size is checked.
Output the log likelihood of the sample, x. The input size is NOT checked.
Mean of the Gaussian
Set the input dimensionality, reset the mean to zero and the variance to one.
Save to a Configuration
Set the variance flooring thresholds equal to the given threshold for all the dimensions.
A tuple that represents the dimensionality of the Gaussian (dim_d,).
The diagonal of the (diagonal) covariance matrix
The variance flooring thresholds, i.e. the minimum allowed value of variance in each dimension. The variance will be set to this value if an attempt is made to set it to a smaller value.
Bases: bob.learn.misc._old_library.MachineGMMStatsScalarBase
An ISVBase instance can be seen as a container for U and D when performing Joint Factor Analysis (ISV).
References: [1] ‘Explicit Modelling of Session Variability for Speaker Verification’, R. Vogt, S. Sridharan, Computer Speech & Language, 2008, vol. 22, no. 1, pp. 17-38 [2] ‘Session Variability Modelling for Face Authentication’, C. McCool, R. Wallace, M. McLaren, L. El Shafey, S. Marcel, IET Biometrics, 2013
Constructs a new ISVBaseMachine from a configuration file.
The subspace D for residual variations
The number of Gaussian components
The dimensionality of the supervector space
The dimensionality of the feature space
The dimensionality of the within-class variations subspace (rank of U)
Executes the machine on the GMMStats, and returns the (scalar) output.
Executes the machine on the GMMStats, and returns the (scalar) output. NO CHECK is performed.
Compares this ISVBase with the ‘other’ one to be approximately the same.
Loads the configuration parameters from a configuration file.
Reset the dimensionality of the subspaces U.
Saves the configuration parameters to a configuration file.
The subspace U for within-class variations
The UBM GMM attached to this Joint Factor Analysis model
Bases: bob.learn.misc._old_library.MachineGMMStatsScalarBase
An ISVMachine. An attached ISVBase should be provided for Inter-session Variability Modelling. The ISVMachine carries information about the speaker factors z, whereas a ISVBase carries information about the matrices U and D.
References: [1] ‘Explicit Modelling of Session Variability for Speaker Verification’, R. Vogt, S. Sridharan, Computer Speech & Language, 2008, vol. 22, no. 1, pp. 17-38 [2] ‘Session Variability Modelling for Face Authentication’, C. McCool, R. Wallace, M. McLaren, L. El Shafey, S. Marcel, IET Biometrics, 2013
Constructs a new ISVMachine from a configuration file.
The number of Gaussian components
The dimensionality of the supervector space
The dimensionality of the feature space
The dimensionality of the within-class variations subspace (rank of U)
Estimates Ux (LPT assumption) given GMM statistics.
Estimates the session offset x (LPT assumption) given GMM statistics.
Executes the machine on the GMMStats, and returns the (scalar) output.
Executes the machine on the GMMStats, and returns the (scalar) output. NO CHECK is performed.
Processes the GMM statistics and Ux to return a score.
Compares this ISVBase with the ‘other’ one to be approximately the same.
The ISVBase attached to this machine
Loads the configuration parameters from a configuration file.
Saves the configuration parameters to a configuration file.
The latent variable z of this machine
Bases: Boost.Python.instance
A trainer for Inter-session Variability Modelling (ISV).
References: [1] ‘Explicit Modelling of Session Variability for Speaker Verification’, R. Vogt, S. Sridharan, Computer Speech & Language, 2008, vol. 22, no. 1, pp. 17-38 [2] ‘Session Variability Modelling for Face Authentication’, C. McCool, R. Wallace, M. McLaren, L. El Shafey, S. Marcel, IET Biometrics, 2013
Initializes a new ISVTrainer.
Accumulator updated during the E-step
Accumulator updated during the E-step
Call the e-step procedure.
Call the enrolment procedure.
Call the finalization procedure.
Call the initialization procedure.
Compares this ISVTrainer with the ‘other’ one to be approximately the same.
Call the m-step procedure.
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
Call the training procedure.
Bases: Boost.Python.instance
An IVectorMachine to extract i-vector.
References: [1] ‘Front End Factor Analysis for Speaker Verification’, N. Dehak, P. Kenny, R. Dehak, P. Dumouchel, P. Ouellet, IEEE Transactions on Audio, Speech and Language Processing, 2010, vol. 19, issue 4, pp. 788-798
Builds a new IVectorMachine.
The number of Gaussian components
The dimensionality of the supervector space
The dimensionality of the feature space
The dimensionality of the Total Variability subspace (rank of T)
Executes the machine on the GMMStats, and updates the ivector array.
Executes the machine on the GMMStats, and updates the ivector array. NO CHECK is performed.
Compares this IVectorMachine with the ‘other’ one to be approximately the same.
Loads the configuration parameters from a configuration file.
Reset the dimensionality of the Total Variability subspace T.
Saves the configuration parameters to a configuration file.
The residual matrix of the model sigma
The subspace T (Total Variability matrix)
The UBM GMM attached to this Joint Factor Analysis model
Threshold for the variance contained in sigma
Bases: bob.learn.misc._old_library.EMTrainerIVector
An trainer to extract i-vector (i.e. for training the Total Variability matrix)
References: [1] ‘Front End Factor Analysis for Speaker Verification’, N. Dehak, P. Kenny, R. Dehak, P. Dumouchel, P. Ouellet, IEEE Transactions on Audio, Speech and Language Processing, 2010, vol. 19, issue 4, pp. 788-798
Builds a new IVectorTrainer.
Accumulator updated during the E-step
Accumulator updated during the E-step
Accumulator updated during the E-step
Accumulator updated during the E-step
Computes the current log likelihood given the hidden variable distribution (or the sufficient statistics)
Indicates whether the log likelihood should be computed during EM or not
Convergence threshold
Updates the hidden variable distribution (or the sufficient statistics) given the Machine parameters.
This method is called at the end of the EM algorithm
This method is called before the EM algorithm
Compares this IVectorTrainer with the ‘other’ one to be approximately the same.
Updates the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
Trains a machine using data
Bases: bob.learn.misc._old_library.MachineGMMStatsScalarBase
A JFABase instance can be seen as a container for U, V and D when performing Joint Factor Analysis (JFA).
References: [1] ‘Explicit Modelling of Session Variability for Speaker Verification’, R. Vogt, S. Sridharan, Computer Speech & Language, 2008, vol. 22, no. 1, pp. 17-38 [2] ‘Session Variability Modelling for Face Authentication’, C. McCool, R. Wallace, M. McLaren, L. El Shafey, S. Marcel, IET Biometrics, 2013
Constructs a new JFABaseMachine from a configuration file.
The subspace D for residual variations
The number of Gaussian components
The dimensionality of the supervector space
The dimensionality of the feature space
The dimensionality of the within-class variations subspace (rank of U)
The dimensionality of the between-class variations subspace (rank of V)
Executes the machine on the GMMStats, and returns the (scalar) output.
Executes the machine on the GMMStats, and returns the (scalar) output. NO CHECK is performed.
Compares this JFABase with the ‘other’ one to be approximately the same.
Loads the configuration parameters from a configuration file.
Reset the dimensionality of the subspaces U and V.
Saves the configuration parameters to a configuration file.
The subspace U for within-class variations
The UBM GMM attached to this Joint Factor Analysis model
The subspace V for between-class variations
Bases: bob.learn.misc._old_library.MachineGMMStatsScalarBase
A JFAMachine. An attached JFABase should be provided for Joint Factor Analysis. The JFAMachine carries information about the speaker factors y and z, whereas a JFABase carries information about the matrices U, V and D.
References: [1] ‘Explicit Modelling of Session Variability for Speaker Verification’, R. Vogt, S. Sridharan, Computer Speech & Language, 2008, vol. 22, no. 1, pp. 17-38 [2] ‘Session Variability Modelling for Face Authentication’, C. McCool, R. Wallace, M. McLaren, L. El Shafey, S. Marcel, IET Biometrics, 2013
Constructs a new JFAMachine from a configuration file.
The number of Gaussian components
The dimensionality of the supervector space
The dimensionality of the feature space
The dimensionality of the within-class variations subspace (rank of U)
The dimensionality of the between-class variations subspace (rank of V)
Estimates Ux (LPT assumption) given GMM statistics.
Estimates the session offset x (LPT assumption) given GMM statistics.
Executes the machine on the GMMStats, and returns the (scalar) output.
Executes the machine on the GMMStats, and returns the (scalar) output. NO CHECK is performed.
Processes the GMM statistics and Ux to return a score.
Compares this JFABase with the ‘other’ one to be approximately the same.
The JFABase attached to this machine
Loads the configuration parameters from a configuration file.
Saves the configuration parameters to a configuration file.
The latent variable y of this machine
The latent variable z of this machine
Bases: Boost.Python.instance
A trainer for Joint Factor Analysis (JFA).
References: [1] ‘Explicit Modelling of Session Variability for Speaker Verification’, R. Vogt, S. Sridharan, Computer Speech & Language, 2008, vol. 22, no. 1, pp. 17-38 [2] ‘Session Variability Modelling for Face Authentication’, C. McCool, R. Wallace, M. McLaren, L. El Shafey, S. Marcel, IET Biometrics, 2013
Initializes a new JFATrainer.
Accumulator updated during the E-step
Accumulator updated during the E-step
Accumulator updated during the E-step
Accumulator updated during the E-step
Accumulator updated during the E-step
Accumulator updated during the E-step
Call the 1st e-step procedure (for the V subspace).
Call the 2nd e-step procedure (for the U subspace).
Call the 3rd e-step procedure (for the d subspace).
Call the enrolment procedure.
Call the 1st finalization procedure (for the V subspace).
Call the 2nd finalization procedure (for the U subspace).
Call the 3rd finalization procedure (for the d subspace).
Call the initialization procedure.
Compares this JFATrainer with the ‘other’ one to be approximately the same.
Call the 1st m-step procedure (for the V subspace).
Call the 2nd m-step procedure (for the U subspace).
Call the 3rd m-step procedure (for the d subspace).
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
Call the training procedure.
Call the training procedure (without the initialization). This will train the three subspaces U, V and d.
Bases: bob.learn.misc._old_library.MachineDoubleBase
This class implements a k-means classifier. See Section 9.1 of Bishop, “Pattern recognition and machine learning”, 2006
__init__( (object)arg1, (object)arg2) -> object
__init__( (object)self, (int)n_means, (int)n_inputs) -> None
__init__( (object)self, (KMeansMachine)other) -> None
Number of means (k)
Number of inputs
Executes the machine on the given 1D numpy array of float64, and returns the output.
Executes the machine on the given 1D numpy array of float64, and returns the output. NO CHECK is performed.
Calculate the index of the mean that is closest (in terms of square Euclidean distance) to the data sample, x
Return the power of two of the square Euclidean distance of the sample, x, to the i’th mean
Get the i’th mean
Output the minimum square Euclidean distance between the input and one of the means
For each mean, find the subset of the samples that is closest to that mean, and calculate 1) the variance of that subset (the cluster variance) 2) the proportion of the samples represented by that subset (the cluster weight)
Compares this KMeansMachine with the ‘other’ one to be approximately the same.
Load from a Configuration
The mean vectors
Resize the number of means and inputs
Save to a Configuration
Set the i’th mean
Bases: bob.learn.misc._old_library.EMTrainerKMeans
Trains a KMeans machine. This class implements the expectation-maximization algorithm for a k-means machine. See Section 9.1 of Bishop, “Pattern recognition and machine learning”, 2006 It uses a random initialization of the means followed by the expectation-maximization algorithm
Average min (square Euclidean) distance. Useful to parallelize the E-step.
Returns the average min (square Euclidean) distance
Convergence threshold
Update the hidden variable distribution (or the sufficient statistics) given the Machine parameters. Also, calculate the average output of the Machine given these parameters. Return the average output of the Machine across the dataset. The EM algorithm will terminate once the change in average_output is less than the convergence_threshold.
This method is called after the EM algorithm
The first order statistics. Useful to parallelize the E-step.
The initialization method to generate the initial means.
Bases: Boost.Python.enum
Number of bits necessary to represent self in binary. >>> bin(37) ‘0b100101’ >>> (37).bit_length() 6
Returns self, the complex conjugate of any int.
the denominator of a rational number in lowest terms
the imaginary part of a complex number
the numerator of a rational number in lowest terms
the real part of a complex number
This method is called before the EM algorithm
Update the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of the means.
Train a machine using data
The zeroeth order statistics. Useful to parallelize the E-step.
Bases: bob.learn.misc._old_library.GMMTrainer
This class implements the maximum a posteriori M-step of the expectation-maximisation algorithm for a GMM Machine. The prior parameters are encoded in the form of a GMM (e.g. a universal background model). The EM algorithm thus performs GMM adaptation. See Section 3.4 of Reynolds et al., “Speaker Verification Using Adapted Gaussian Mixture Models”, Digital Signal Processing, 2000. We use a “single adaptation coefficient”, alpha_i, and thus a single relevance factor, r.
Returns the likelihood.
Convergence threshold
Update the hidden variable distribution (or the sufficient statistics) given the Machine parameters. Also, calculate the average output of the Machine given these parameters. Return the average output of the Machine across the dataset. The EM algorithm will terminate once the change in average_output is less than the convergence_threshold.
This method is called after the EM algorithm
The internal GMM statistics. Useful to parallelize the E-step.
This method is called before the EM algorithm
Update the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
Set the GMM to use as a prior for MAP adaptation. Generally, this is a “universal background model” (UBM), also referred to as a “world model”.
Use a torch3-like MAP adaptation rule instead of Reynolds’one.
Train a machine using data
Use a Reynolds’ MAP adaptation (rather than torch3-like).
Bases: bob.learn.misc._old_library.GMMTrainer
This class implements the maximum likelihood M-step of the expectation-maximisation algorithm for a GMM Machine. See Section 9.2.2 of Bishop, “Pattern recognition and machine learning”, 2006
Returns the likelihood.
Convergence threshold
Update the hidden variable distribution (or the sufficient statistics) given the Machine parameters. Also, calculate the average output of the Machine given these parameters. Return the average output of the Machine across the dataset. The EM algorithm will terminate once the change in average_output is less than the convergence_threshold.
This method is called after the EM algorithm
The internal GMM statistics. Useful to parallelize the E-step.
This method is called before the EM algorithm
Update the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
Train a machine using data
Bases: Boost.Python.instance
Root class for all Machine<blitz::Array<double,1>, double>
Raises an exception This class cannot be instantiated from Python
Executes the machine on the given 1D numpy array of float64, and returns the output.
Executes the machine on the given 1D numpy array of float64, and returns the output. NO CHECK is performed.
Bases: Boost.Python.instance
Root class for all Machine<bob::learn::misc::GMMStats, blitz::Array<double,1>
Raises an exception This class cannot be instantiated from Python
Executes the machine on the GMMStats, and returns the (scalar) output.
Executes the machine on the GMMStats, and returns the (scalar) output. NO CHECK is performed.
Bases: Boost.Python.instance
Root class for all Machine<bob::learn::misc::GMMStats, double>
Raises an exception This class cannot be instantiated from Python
Executes the machine on the GMMStats, and returns the (scalar) output.
Executes the machine on the GMMStats, and returns the (scalar) output. NO CHECK is performed.
Bases: Boost.Python.instance
A PLDABase can be seen as a container for the subspaces F, G, the diagonal covariance matrix sigma (stored as a 1D array) and the mean vector mu when performing Probabilistic Linear Discriminant Analysis (PLDA). PLDA is a probabilistic model that incorporates components describing both between-class and within-class variations. A PLDABase can be shared between several PLDAMachine that contains class-specific information (information about the enrolment samples).
References: 1. ‘A Scalable Formulation of Probabilistic Linear Discriminant Analysis: Applied to Face Recognition’, Laurent El Shafey, Chris McCool, Roy Wallace, Sebastien Marcel, TPAMI‘2013 2. ‘Probabilistic Linear Discriminant Analysis for Inference About Identity’, Prince and Elder, ICCV‘2007. 3. ‘Probabilistic Models for Inference about Identity’, Li, Fu, Mohammed, Elder and Prince, TPAMI‘2012.
Builds a new PLDABase. dim_d is the dimensionality of the input features, dim_f is the dimensionality of the F subspace and dim_g the dimensionality of the G subspace. The variance flooring threshold is the minimum value that the variance sigma can reach, as this diagonal matrix is inverted.
Clear the maps containing the gamma’s as well as the log likelihood constant term for few number of samples. These maps are used to make likelihood computations faster.
Computes the gamma matrix for the given number of samples. (gamma = inverse(I+a.F^T.beta.F), please check the documentation/source code for more details.
Computes the log likelihood constant term for the given number of samples.
Computes the log-likelihood of a sample given the latent variables hi and wij (point estimate rather than Bayesian-like full integration).
Dimensionality of the input feature vectors
Dimensionality of the F subspace/matrix of the PLDA model
Dimensionality of the G subspace/matrix of the PLDA model
The subspace/matrix F of the PLDA model
The subspace/matrix G of the PLDA model
Computes the gamma matrix for the given number of samples. (gamma = inverse(I+a.F^T.beta.F), please check the documentation/source code for more details.
Computes the log likelihood constant term for the given number of samples, and adds it to the machine (as well as gamma), if it does not already exist.
Returns the gamma matrix for the given number of samples if it has already been put in cache. Throws an exception otherwise. (gamma = inverse(I+a.F^T.beta.F), please check the documentation/source code for more details.
Returns the log likelihood constant term for the given number of samples if it has already been put in cache. Throws an exception otherwise.
Tells if the gamma matrix for the given number of samples has already been computed. (gamma = inverse(I+a.F^T.beta.F), please check the documentation/source code for more details.
Tells if the log likelihood constant term for the given number of samples has already been computed.
Compares this PLDABase with the ‘other’ one to be approximately the same.
Loads the configuration parameters from a configuration file.
The mean vector mu of the PLDA model
Resizes the dimensionality of the PLDA model. Paramaters mu, F, G and sigma are reinitialized.
Saves the configuration parameters to a configuration file.
The diagonal covariance matrix (represented by a 1D numpy array) sigma of the PLDA model
The variance flooring threshold, i.e. the minimum allowed value of variance (sigma) in each dimension. The variance sigma will be set to this value if an attempt is made to set it to a smaller value.
Bases: Boost.Python.instance
A PLDAMachine contains class-specific information (from the enrolment samples) when performing Probabilistic Linear Discriminant Analysis (PLDA). It should be attached to a PLDABase that contains information such as the subspaces F and G.
References: 1. ‘A Scalable Formulation of Probabilistic Linear Discriminant Analysis: Applied to Face Recognition’, Laurent El Shafey, Chris McCool, Roy Wallace, Sebastien Marcel, TPAMI‘2013 2. ‘Probabilistic Linear Discriminant Analysis for Inference About Identity’, Prince and Elder, ICCV‘2007. 3. ‘Probabilistic Models for Inference about Identity’, Li, Fu, Mohammed, Elder and Prince, TPAMI‘2012.
Builds a new PLDAMachine. An attached PLDABase should be provided, that can be shared by several PLDAMachine.
Clears the maps containing the gamma’s as well as the log likelihood constant term for few number of samples. These maps are used to make likelihood computations faster.
Computes the log-likelihood considering only the probe sample(s) or jointly the probe sample(s) and the enrolled samples.
Dimensionality of the input feature vectors
Dimensionality of the F subspace/matrix of the PLDA model
Dimensionality of the G subspace/matrix of the PLDA model
Processes a sample and returns a log-likelihood ratio score.
Computes the gamma matrix for the given number of samples. (gamma = inverse(I+a.F^T.beta.F), please check the documentation/source code for more details.
Computes the log likelihood constant term for the given number of samples, and adds it to the machine (as well as gamma), if it does not already exist.
Returns the gamma matrix for the given number of samples if it has already been put in cache. Throws an exception otherwise. (gamma = inverse(I+a.F^T.beta.F), please check the documentation/source code for more details.
Returns the log likelihood constant term for the given number of samples if it has already been put in cache. Throws an exception otherwise.
Tells if the gamma matrix for the given number of samples has already been computed. (gamma = inverse(I+a.F^T.beta.F), please check the documentation/source code for more details.
Tells if the log likelihood constant term for the given number of samples has already been computed.
Compares this PLDAMachine with the ‘other’ one to be approximately the same.
Loads the configuration parameters from a configuration file. The PLDABase will not be loaded, and has to be set manually using the ‘plda_base’ attribute.
Number of enrolled samples
Saves the configuration parameters to a configuration file. The PLDABase will not be saved, and has to be saved separately, as it can be shared by several PLDAMachines.
Bases: bob.learn.misc._old_library.EMTrainerPLDA
A trainer for Probabilistic Linear Discriminant Analysis (PLDA). The train() method will learn the mu, F, G and Sigma of the model, whereas the enrol() method, will store model information about the enrolment samples for a specific class.
References: 1. ‘A Scalable Formulation of Probabilistic Linear Discriminant Analysis: Applied to Face Recognition’, Laurent El Shafey, Chris McCool, Roy Wallace, Sebastien Marcel, TPAMI‘2013 2. ‘Probabilistic Linear Discriminant Analysis for Inference About Identity’, Prince and Elder, ICCV‘2007. 3. ‘Probabilistic Models for Inference about Identity’, Li, Fu, Mohammed, Elder and Prince, TPAMI‘2012.
Initializes a new PLDATrainer.
Updates the hidden variable distribution (or the sufficient statistics) given the Machine parameters.
Enrol a class-specific model (PLDAMachine) given a set of enrolment samples.
This method is called at the end of the EM algorithm
The method used for the initialization of F.
The ratio used for the initialization of F.
The method used for the initialization of G.
The ratio used for the initialization of G.
The method used for the initialization of sigma.
The ratio used for the initialization of sigma.
This method is called before the EM algorithm
Compares this PLDATrainer with the ‘other’ one to be approximately the same.
Updates the Machine parameters given the hidden variable distribution (or the sufficient statistics)
Max iterations
The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
Trains a PLDABase using data (mu, F, G and sigma are learnt).
Tells whether the second order statistics are stored during the training procedure, or only their sum.
Compute a matrix of scores using linear scoring. Return a 2D matrix of scores, scores[m, s] is the score for model m against statistics s
Warning Each GMM must have the same size.
models – list of mean supervectors for the client models ubm_mean – mean supervector for the world model ubm_variance – variance supervector for the world model test_stats – list of accumulate statistics for each test trial test_channelOffset – frame_length_normlisation – perform a normalisation by the number of feature vectors
Compute a matrix of scores using linear scoring. Return a 2D matrix of scores, scores[m, s] is the score for model m against statistics s
Warning Each GMM must have the same size.
models – list of client models ubm – world model test_stats – list of accumulate statistics for each test trial test_channel_offset – frame_length_normlisation – perform a normalisation by the number of feature vectors
Compute a score using linear scoring.
model – mean supervectors for the client model ubm_mean – mean supervector for the world model ubm_variance – variance supervector for the world model test_stats – accumulate statistics for each test trial test_channelOffset – frame_length_normlisation – perform a normalisation by the number of feature vectors
Normalise raw scores with T-Norm.
Normalise raw scores with Z-Norm.
Normalise raw scores with ZT-Norm