P(x,y) = wi N(x,y given xi,yi,sxi,syi)where P is the final density function; xi,yi,sxi,syi are the mean and standard deviation of a Gaussian; N(x,y) is the value of the Gaussian at x,y; wi is the weight of this Gaussian
Static Public Member Functions | |
static void | init_gmm (const std::vector< float > &x, const std::vector< float > &y, int n_models, std::vector< GaussianComponent > &mixture) |
simply slices the input and initializes a GMM fit to each slice. | |
static void | init_gmm (const std::vector< float > &x, const std::vector< float > &y, const std::vector< int > &startindex, int desired_n_models, std::vector< GaussianComponent > &mixture) |
Uses user-defined slices and initializes a GMM fit. | |
static float | tune_gmm_em (const std::vector< float > &x, const std::vector< float > &y, std::vector< GaussianComponent > &mixture, const float min_improvement=0.05, const int max_iter=10) |
Tunes an initialized GMM using the Expectation-Minimization algorithm. | |
static float | fit (const std::vector< float > &x, const std::vector< float > &y, std::vector< GaussianComponent > &mixture, int max_n_models=-1) |
Uses the Bayesian Information Criterion to come up with a reasonable number for number of models. | |
Classes | |
class | GaussianComponent |
static float w2img::GaussianMixtureModel::fit | ( | const std::vector< float > & | x, | |
const std::vector< float > & | y, | |||
std::vector< GaussianComponent > & | mixture, | |||
int | max_n_models = -1 | |||
) | [static] |
Uses the Bayesian Information Criterion to come up with a reasonable number for number of models.
static void w2img::GaussianMixtureModel::init_gmm | ( | const std::vector< float > & | x, | |
const std::vector< float > & | y, | |||
const std::vector< int > & | startindex, | |||
int | desired_n_models, | |||
std::vector< GaussianComponent > & | mixture | |||
) | [static] |
Uses user-defined slices and initializes a GMM fit.
The startindex provides the starting index for each slice. Slices will be combined/split to match the desired number of models.
static void w2img::GaussianMixtureModel::init_gmm | ( | const std::vector< float > & | x, | |
const std::vector< float > & | y, | |||
int | n_models, | |||
std::vector< GaussianComponent > & | mixture | |||
) | [static] |
simply slices the input and initializes a GMM fit to each slice.
static float w2img::GaussianMixtureModel::tune_gmm_em | ( | const std::vector< float > & | x, | |
const std::vector< float > & | y, | |||
std::vector< GaussianComponent > & | mixture, | |||
const float | min_improvement = 0.05 , |
|||
const int | max_iter = 10 | |||
) | [static] |
Tunes an initialized GMM using the Expectation-Minimization algorithm.
min_improvement | If improvement in log(likelihood) is less than this ratio (0.05 indicates 5%), EM process is stopped. | |
max_iter | Maximum number of EM iterations |