bob.trainer.PLDATrainer

class bob.trainer.PLDATrainer((object)arg1) → None

Bases: bob.trainer._trainer.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.

__init__( (object)self [, (int)max_iterations=100 [, (bool)use_sum_second_order=True]]) -> None :
Initializes a new PLDATrainer.
__init__( (object)self, (PLDATrainer)trainer) -> None :
Copy constructs a PLDATrainer
__init__((object)arg1) → None
__init__( (object)self [, (int)max_iterations=100 [, (bool)use_sum_second_order=True]]) -> None :
Initializes a new PLDATrainer.
__init__( (object)self, (PLDATrainer)trainer) -> None :
Copy constructs a PLDATrainer

Methods

__init__((object)arg1) __init__( (object)self [, (int)max_iterations=100 [, (bool)use_sum_second_order=True]]) -> None :
e_step((EMTrainerPLDA)self, …) Updates the hidden variable distribution (or the sufficient statistics) given the Machine parameters.
enrol((PLDATrainer)self, …) Enrol a class-specific model (PLDAMachine) given a set of enrolment samples.
finalize((EMTrainerPLDA)self, …) This method is called at the end of the EM algorithm
initialize((EMTrainerPLDA)self, …) This method is called before the EM algorithm
is_similar_to((PLDATrainer)self, …) Compares this PLDATrainer with the ‘other’ one to be approximately the same.
m_step((EMTrainerPLDA)self, …) Updates the Machine parameters given the hidden variable distribution (or the sufficient statistics)
train((EMTrainerPLDA)self, …) Trains a PLDABase using data (mu, F, G and sigma are learnt).

Attributes

BETWEEN_SCATTER
CONSTANT
RANDOM_F
RANDOM_G
RANDOM_SIGMA
VARIANCE_DATA
VARIANCE_G
WITHIN_SCATTER
init_f_method The method used for the initialization of F.
init_f_ratio The ratio used for the initialization of F.
init_g_method The method used for the initialization of G.
init_g_ratio The ratio used for the initialization of G.
init_sigma_method The method used for the initialization of sigma.
init_sigma_ratio The ratio used for the initialization of sigma.
max_iterations Max iterations
rng The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.
use_sum_second_order Tells whether the second order statistics are stored during the training procedure, or only their sum.
z_first_order
z_second_order
z_second_order_sum
BETWEEN_SCATTER = bob.trainer._trainer.init_f_method.BETWEEN_SCATTER
CONSTANT = bob.trainer._trainer.init_sigma_method.CONSTANT
RANDOM_F = bob.trainer._trainer.init_f_method.RANDOM_F
RANDOM_G = bob.trainer._trainer.init_g_method.RANDOM_G
RANDOM_SIGMA = bob.trainer._trainer.init_sigma_method.RANDOM_SIGMA
VARIANCE_DATA = bob.trainer._trainer.init_sigma_method.VARIANCE_DATA
VARIANCE_G = bob.trainer._trainer.init_sigma_method.VARIANCE_G
WITHIN_SCATTER = bob.trainer._trainer.init_g_method.WITHIN_SCATTER
e_step((EMTrainerPLDA)self, (PLDABase)machine, (object)data) → None :

Updates the hidden variable distribution (or the sufficient statistics) given the Machine parameters.

enrol((PLDATrainer)self, (PLDAMachine)plda_machine, (object)data) → None :

Enrol a class-specific model (PLDAMachine) given a set of enrolment samples.

finalize((EMTrainerPLDA)self, (PLDABase)machine, (object)data) → None :

This method is called at the end of the EM algorithm

init_f_method

The method used for the initialization of F.

init_f_ratio

The ratio used for the initialization of F.

init_g_method

The method used for the initialization of G.

init_g_ratio

The ratio used for the initialization of G.

init_sigma_method

The method used for the initialization of sigma.

init_sigma_ratio

The ratio used for the initialization of sigma.

initialize((EMTrainerPLDA)self, (PLDABase)machine, (object)data) → None :

This method is called before the EM algorithm

is_similar_to((PLDATrainer)self, (PLDATrainer)other[, (float)r_epsilon=1e-05[, (float)a_epsilon=1e-08]]) → bool :

Compares this PLDATrainer with the ‘other’ one to be approximately the same.

m_step((EMTrainerPLDA)self, (PLDABase)machine, (object)data) → None :

Updates the Machine parameters given the hidden variable distribution (or the sufficient statistics)

max_iterations

Max iterations

rng

The Mersenne Twister mt19937 random generator used for the initialization of subspaces/arrays before the EM loop.

train((EMTrainerPLDA)self, (PLDABase)machine, (object)data) → None :

Trains a PLDABase using data (mu, F, G and sigma are learnt).

use_sum_second_order

Tells whether the second order statistics are stored during the training procedure, or only their sum.

z_first_order
z_second_order
z_second_order_sum