Gaussian Mixture Model interface.
Takes input of number of Gaussians to fit and a covariance type to use. Parameter estimation is done using either the Expectation-Maximization or Split-Merge Expectation-Maximization algorithms. To estimate the GMM parameters, the train(...) method has to be run to set the training data and then either train_em(...) or train_smem(...) to do the actual estimation. The EM algorithm is described here: http://en.wikipedia.org/wiki/Expectation-maximization_algorithm The SMEM algorithm is described here: http://mlg.eng.cam.ac.uk/zoubin/papers/uedanc.pdf
Definition at line 36 of file GMM.h.
Public Member Functions | |
CGMM () | |
CGMM (int32_t n, ECovType cov_type=FULL) | |
CGMM (SGVector< CGaussian * > components, SGVector< float64_t > coefficients, bool copy=false) | |
virtual | ~CGMM () |
void | cleanup () |
virtual bool | train (CFeatures *data=NULL) |
float64_t | train_em (float64_t min_cov=1e-9, int32_t max_iter=1000, float64_t min_change=1e-9) |
float64_t | train_smem (int32_t max_iter=100, int32_t max_cand=5, float64_t min_cov=1e-9, int32_t max_em_iter=1000, float64_t min_change=1e-9) |
void | max_likelihood (SGMatrix< float64_t > alpha, float64_t min_cov) |
virtual int32_t | get_num_model_parameters () |
virtual float64_t | get_log_model_parameter (int32_t num_param) |
virtual float64_t | get_log_derivative (int32_t num_param, int32_t num_example) |
virtual float64_t | get_log_likelihood_example (int32_t num_example) |
virtual float64_t | get_likelihood_example (int32_t num_example) |
virtual SGVector< float64_t > | get_nth_mean (int32_t num) |
virtual void | set_nth_mean (SGVector< float64_t > mean, int32_t num) |
virtual SGMatrix< float64_t > | get_nth_cov (int32_t num) |
virtual void | set_nth_cov (SGMatrix< float64_t > cov, int32_t num) |
virtual SGVector< float64_t > | get_coef () |
virtual void | set_coef (SGVector< float64_t > coefficients) |
virtual SGVector< CGaussian * > | get_comp () |
virtual void | set_comp (SGVector< CGaussian * > components) |
SGVector< float64_t > | sample () |
SGVector< float64_t > | cluster (SGVector< float64_t > point) |
virtual const char * | get_name () const |
Protected Attributes | |
SGVector< CGaussian * > | m_components |
SGVector< float64_t > | m_coefficients |
virtual float64_t get_likelihood_example | ( | int32_t | num_example | ) | [virtual] |
compute likelihood for example
abstract base method
num_example | which example |
Reimplemented from CDistribution.
float64_t get_log_derivative | ( | int32_t | num_param, | |
int32_t | num_example | |||
) | [virtual] |
get partial derivative of likelihood function (logarithmic)
num_param | derivative against which param | |
num_example | which example |
Implements CDistribution.
float64_t get_log_likelihood_example | ( | int32_t | num_example | ) | [virtual] |
compute log likelihood for example
abstract base method
num_example | which example |
Implements CDistribution.
float64_t get_log_model_parameter | ( | int32_t | num_param | ) | [virtual] |
get model parameter (logarithmic)
Implements CDistribution.
virtual const char* get_name | ( | void | ) | const [virtual] |
int32_t get_num_model_parameters | ( | ) | [virtual] |
bool train | ( | CFeatures * | data = NULL |
) | [virtual] |
set training data for use with EM or SMEM
data | training data |
init features with data if necessary and assure type is correct
Implements CDistribution.
SGVector<float64_t> m_coefficients [protected] |
SGVector<CGaussian*> m_components [protected] |