itpp::MOG_diag_kmeans_sup Class Reference

support class for MOG_diag_kmeans() More...

`#include <itpp/stat/mog_diag_kmeans.h>`

Inheritance diagram for itpp::MOG_diag_kmeans_sup:

## Public Member Functions

| MOG_diag_kmeans_sup ()
| Default constructor.
| ~MOG_diag_kmeans_sup ()
| Default destructor.
void | run (MOG_diag &model_in, Array< vec > &X_in, int max_iter_in=10, double trust_in=0.5, bool normalise_in=true, bool verbose_in=false)
| ADD DOCUMENTATION HERE.
void | cleanup ()
| Release memory used by the model. The model will be empty.
void | load (const std::string &name_in)
| Initialise the model by loading the parameters from a model file.
void | convert_to_full ()
| Do nothing. Present for compatability with the MOG_generic class.
double | log_lhood_single_gaus (const double *c_x_in, const int k) const
| calculate the log likelihood of C vector `c_x_in` using only Gaussian `k`
double | log_lhood_single_gaus (const vec &x_in, const int k) const
| calculate the log likelihood of IT++ vector `x_in` using only Gaussian `k`
virtual double | log_lhood_single_gaus (const vec &x_in, const int k)
| calculate the log likelihood of vector `x_in` using only Gaussian `k`
double | log_lhood (const double *c_x_in)
| calculate the log likelihood of C vector `c_x_in`
double | log_lhood (const vec &x_in)
| calculate the log likelihood of IT++ vector `x_in`
double | lhood (const double *c_x_in)
| calculate the likelihood of C vector `c_x_in`
double | lhood (const vec &x_in)
| calculate the likelihood of IT++ vector `x_in`
double | avg_log_lhood (const double **c_x_in, int N)
| calculate the average log likelihood of an array of C vectors ( `c_x_in` )
double | avg_log_lhood (const Array< vec > &X_in)
| calculate the average log likelihood of an array of IT++ vectors ( `X_in` )
void | init ()
| Initialise the model to be empty.
void | init (const int &K_in, const int &D_in, bool full_in=false)
| initialise the model so that all Gaussians have zero mean and unit variance for all dimensions
void | init (Array< vec > &means_in, bool full_in=false)
| Initialise the model using user supplied mean vectors.
void | init (Array< vec > &means_in, Array< vec > &diag_covs_in, vec &weights_in)
| Initialise the model using user supplied parameters (diagonal covariance version).
void | init (Array< vec > &means_in, Array< mat > &full_covs_in, vec &weights_in)
| Initialise the model using user supplied parameters (full covariance version).
bool | is_valid () const
| Returns true if the model's parameters are valid.
bool | is_full () const
| Returns true if the model has full covariance matrices.
int | get_K () const
| Return the number of Gaussians.
int | get_D () const
| Return the dimensionality.
vec | get_weights () const
| Obtain a copy of the weight vector.
Array< vec > | get_means () const
| Obtain a copy of the array of mean vectors.
Array< vec > | get_diag_covs () const
| Obtain a copy of the array of diagonal covariance vectors.
Array< mat > | get_full_covs () const
| Obtain a copy of the array of full covariance matrices.
void | set_means (Array< vec > &means_in)
| Set the means of the model.
void | set_diag_covs (Array< vec > &diag_covs_in)
| Set the diagonal covariance vectors of the model.
void | set_full_covs (Array< mat > &full_covs_in)
| Set the full covariance matrices of the model.
void | set_weights (vec &weights_in)
| Set the weight vector of the model.
void | set_means_zero ()
| Set the means in the model to be zero.
void | set_diag_covs_unity ()
| Set the diagonal covariance vectors to be unity.
void | set_full_covs_unity ()
| Set the full covariance matrices to be unity.
void | set_weights_uniform ()
| Set all the weights to 1/K, where K is the number of Gaussians.
void | set_checks (bool do_checks_in)
| Enable/disable internal checks for likelihood functions.
void | set_paranoid (bool paranoid_in)
| Enable/disable paranoia about numerical stability.
virtual void | save (const std::string &name_in) const
| Save the model's parameters to a model file.
virtual void | join (const MOG_generic &B_in)
| Mathematically join the model with a user supplied model.
virtual void | convert_to_diag ()
| Convert the model to use diagonal covariances.

## Protected Member Functions

double | dist (const double *x, const double *y) const
| ADD DOCUMENTATION HERE.
void | assign_to_means ()
| ADD DOCUMENTATION HERE.
void | recalculate_means ()
| ADD DOCUMENTATION HERE.
bool | dezombify_means ()
| ADD DOCUMENTATION HERE.
double | measure_change () const
| ADD DOCUMENTATION HERE.
void | initial_means ()
| ADD DOCUMENTATION HERE.
void | iterate ()
| ADD DOCUMENTATION HERE.
void | calc_means ()
| ADD DOCUMENTATION HERE.
void | calc_covs ()
| ADD DOCUMENTATION HERE.
void | calc_weights ()
| ADD DOCUMENTATION HERE.
void | normalise_vectors ()
| ADD DOCUMENTATION HERE.
void | unnormalise_vectors ()
| ADD DOCUMENTATION HERE.
void | unnormalise_means ()
| ADD DOCUMENTATION HERE.
void | setup_means ()
| additional processing of mean vectors, done as the last step of mean initialisation
void | setup_covs ()
| additional processing of covariance vectors/matrices, done as the last step of covariance initialisation
void | setup_weights ()
| additional processing of the weight vector, done as the last step of weight initialisation
void | setup_misc ()
| additional processing of miscellaneous parameters, done as the last step of overall initialisation
double | log_lhood_single_gaus_internal (const double *c_x_in, const int k) const
| ADD DOCUMENTATION HERE.
double | log_lhood_single_gaus_internal (const vec &x_in, const int k) const
| ADD DOCUMENTATION HERE.
virtual double | log_lhood_single_gaus_internal (const vec &x_in, const int k)
| ADD DOCUMENTATION HERE.
double | log_lhood_internal (const double *c_x_in)
| ADD DOCUMENTATION HERE.
double | log_lhood_internal (const vec &x_in)
| ADD DOCUMENTATION HERE.
double | lhood_internal (const double *c_x_in)
| ADD DOCUMENTATION HERE.
double | lhood_internal (const vec &x_in)
| ADD DOCUMENTATION HERE.
double ** | enable_c_access (Array< vec > &A_in)
| Enable C style access to an Array of vectors (vec).
int ** | enable_c_access (Array< ivec > &A_in)
| Enable C style access to an Array of vectors (ivec).
double * | enable_c_access (vec &v_in)
| Enable C style access to a vector (vec).
int * | enable_c_access (ivec &v_in)
| Enable C style access to a vector (ivec).
double ** | disable_c_access (double **A_in)
| Disable C style access to an Array of vectors (vec).
int ** | disable_c_access (int **A_in)
| Disable C style access to an Array of vectors (ivec).
double * | disable_c_access (double *v_in)
| Disable C style access to a vector (vec).
int * | disable_c_access (int *v_in)
| Disable C style access to a vector (ivec).
void | zero_all_ptrs ()
| ADD DOCUMENTATION HERE.
void | free_all_ptrs ()
| ADD DOCUMENTATION HERE.
bool | check_size (const vec &x_in) const
| Check if vector `x_in` has the same dimensionality as the model.
bool | check_size (const Array< vec > &X_in) const
| Check if all vectors in Array `X_in` have the same dimensionality as the model.
bool | check_array_uniformity (const Array< vec > &A) const
| Check if all vectors in Array `X_in` have the same dimensionality.
void | set_means_internal (Array< vec > &means_in)
| ADD DOCUMENTATION HERE.
void | set_diag_covs_internal (Array< vec > &diag_covs_in)
| ADD DOCUMENTATION HERE.
void | set_full_covs_internal (Array< mat > &full_covs_in)
| ADD DOCUMENTATION HERE.
void | set_weights_internal (vec &_weigths)
| ADD DOCUMENTATION HERE.
void | set_means_zero_internal ()
| ADD DOCUMENTATION HERE.
void | set_diag_covs_unity_internal ()
| ADD DOCUMENTATION HERE.
void | set_full_covs_unity_internal ()
| ADD DOCUMENTATION HERE.
void | set_weights_uniform_internal ()
| ADD DOCUMENTATION HERE.
void | convert_to_diag_internal ()
| ADD DOCUMENTATION HERE.
void | convert_to_full_internal ()
| ADD DOCUMENTATION HERE.

## Protected Attributes

int | max_iter
| Maximum number of iterations.
double | trust
| trust factor, where 0 <= trust <= 1.
bool | verbose
| Whether we print the progress.
int | N
| number of training vectors
double ** | c_X
| 'C' pointers to training vectors
Array< vec > | means_old
| means from the previous iteration, used to measure progress
double ** | c_means_old
| 'C' pointers to old means
Array< ivec > | partitions
| contains indices of vectors assigned to each mean
int ** | c_partitions
| 'C' pointers to partition vectors
ivec | count
| keeps a count of the number of vectors assigned to each mean
int * | c_count
| 'C' pointer to the count vector
double ** | c_means
| pointers to the mean vectors
double ** | c_diag_covs
| pointers to the covariance vectors
double ** | c_diag_covs_inv_etc
| pointers to the inverted covariance vectors
double * | c_weights
| pointer to the weight vector
double * | c_log_weights
| pointer to the log version of the weight vector
double * | c_log_det_etc
| pointer to the log_det_etc vector
bool | do_checks
| indicates whether checks on input data are done
bool | valid
| indicates whether the parameters are valid
bool | full
| indicates whether we are using full or diagonal covariance matrices
bool | paranoid
| indicates whether we are paranoid about numerical stability
int | K
| number of gaussians
int | D
| dimensionality
Array< vec > | means
| means
Array< vec > | diag_covs
| diagonal covariance matrices, stored as vectors
Array< mat > | full_covs
| full covariance matrices
vec | weights
| weights
double | log_max_K
| Pre-calcualted std::log(std::numeric_limits<double>::max() / K), where K is the number of Gaussians.
vec | log_det_etc
| Gaussian specific pre-calcualted constants.
vec | log_weights
| Pre-calculated log versions of the weights.
Array< mat > | full_covs_inv
| Pre-calcuated inverted version of each full covariance matrix.
Array< vec > | diag_covs_inv_etc
| Pre-calcuated inverted version of each diagonal covariance vector, where the covariance elements are first multiplied by two.

## Detailed Description

support class for MOG_diag_kmeans()

Author
  Conrad Sanderson

Definition at line 44 of file mog_diag_kmeans.h.

## Constructor & Destructor Documentation

## MOG_diag_kmeans_sup()

itpp::MOG_diag_kmeans_sup::MOG_diag_kmeans_sup | ( |  | ) |

inline

Default constructor.

Definition at line 49 of file mog_diag_kmeans.h.

References verbose.

## ~MOG_diag_kmeans_sup()

itpp::MOG_diag_kmeans_sup::~MOG_diag_kmeans_sup | ( |  | ) |

inline

Default destructor.

Definition at line 52 of file mog_diag_kmeans.h.

## Member Function Documentation

## run()

void itpp::MOG_diag_kmeans_sup::run | ( | MOG_diag & | model_in,
|  | Array< vec > & | X_in,
|  | int | max_iter_in = 10,
|  | double | trust_in = 0.5,
|  | bool | normalise_in = true,
|  | bool | verbose_in = false )

ADD DOCUMENTATION HERE.

Definition at line 264 of file mog_diag_kmeans.cpp.

References c_count, c_means_old, c_partitions, c_X, calc_covs(), calc_means(), calc_weights(), itpp::MOG_generic::check_size(), itpp::MOG_diag::cleanup(), count, itpp::MOG_generic::D, itpp::MOG_generic::diag_covs, itpp::MOG_diag::disable_c_access(), itpp::MOG_diag::enable_c_access(), itpp::MOG_generic::get_diag_covs(), itpp::MOG_generic::get_means(), itpp::MOG_generic::get_weights(), itpp::MOG_generic::init(), itpp::MOG_generic::is_valid(), it_assert, it_warning, itpp::MOG_generic::K, max_iter, itpp::MOG_generic::means, means_old, itpp::MOG_diag::MOG_diag(), N, normalise_vectors(), partitions, itpp::Array< T >::set_size(), itpp::Array< T >::size(), trust, unnormalise_means(), unnormalise_vectors(), verbose, and itpp::MOG_generic::weights.

Referenced by itpp::MOG_diag_kmeans().

## dist()

double itpp::MOG_diag_kmeans_sup::dist | ( | const double * | x,
|  | const double * | y ) const

inline protected

ADD DOCUMENTATION HERE.

Definition at line 36 of file mog_diag_kmeans.cpp.

References itpp::MOG_generic::D.

Referenced by assign_to_means(), and measure_change().

## assign_to_means()

void itpp::MOG_diag_kmeans_sup::assign_to_means | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 43 of file mog_diag_kmeans.cpp.

References c_count, itpp::MOG_diag::c_means, c_partitions, c_X, count, dist(), itpp::MOG_generic::K, and N.

Referenced by dezombify_means(), and iterate().

## recalculate_means()

void itpp::MOG_diag_kmeans_sup::recalculate_means | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 65 of file mog_diag_kmeans.cpp.

References c_count, itpp::MOG_diag::c_means, c_partitions, c_X, itpp::MOG_generic::D, and itpp::MOG_generic::K.

Referenced by iterate().

## dezombify_means()

bool itpp::MOG_diag_kmeans_sup::dezombify_means | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 88 of file mog_diag_kmeans.cpp.

References assign_to_means(), c_count, itpp::MOG_diag::c_means, c_partitions, c_X, count, itpp::MOG_generic::D, it_warning, itpp::MOG_generic::K, and verbose.

Referenced by iterate().

## measure_change()

double itpp::MOG_diag_kmeans_sup::measure_change | ( |  | ) | const

protected

ADD DOCUMENTATION HERE.

Definition at line 130 of file mog_diag_kmeans.cpp.

References itpp::MOG_diag::c_means, c_means_old, dist(), and itpp::MOG_generic::K.

Referenced by iterate().

## initial_means()

void itpp::MOG_diag_kmeans_sup::initial_means | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 139 of file mog_diag_kmeans.cpp.

References itpp::MOG_diag::c_means, c_X, itpp::MOG_generic::D, itpp::floor(), itpp::MOG_generic::K, and N.

Referenced by calc_means().

## iterate()

void itpp::MOG_diag_kmeans_sup::iterate | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 161 of file mog_diag_kmeans.cpp.

References assign_to_means(), itpp::MOG_diag::c_means, c_means_old, itpp::MOG_generic::D, dezombify_means(), itpp::MOG_generic::K, max_iter, measure_change(), recalculate_means(), and verbose.

Referenced by calc_means().

## calc_means()

void itpp::MOG_diag_kmeans_sup::calc_means | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 183 of file mog_diag_kmeans.cpp.

References initial_means(), and iterate().

Referenced by run().

## calc_covs()

void itpp::MOG_diag_kmeans_sup::calc_covs | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 190 of file mog_diag_kmeans.cpp.

References c_count, itpp::MOG_diag::c_diag_covs, itpp::MOG_diag::c_means, c_partitions, c_X, itpp::MOG_generic::D, itpp::MOG_generic::K, and trust.

Referenced by run().

## calc_weights()

void itpp::MOG_diag_kmeans_sup::calc_weights | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 216 of file mog_diag_kmeans.cpp.

References c_count, itpp::MOG_diag::c_weights, itpp::MOG_generic::K, N, and trust.

Referenced by run().

## normalise_vectors()

void itpp::MOG_diag_kmeans_sup::normalise_vectors | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 222 of file mog_diag_kmeans.cpp.

References c_X, itpp::MOG_generic::D, and N.

Referenced by run().

## unnormalise_vectors()

void itpp::MOG_diag_kmeans_sup::unnormalise_vectors | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 244 of file mog_diag_kmeans.cpp.

References c_X, itpp::MOG_generic::D, and N.

Referenced by run().

## unnormalise_means()

void itpp::MOG_diag_kmeans_sup::unnormalise_means | ( |  | ) |

protected

ADD DOCUMENTATION HERE.

Definition at line 254 of file mog_diag_kmeans.cpp.

References itpp::MOG_diag::c_means, itpp::MOG_generic::D, and itpp::MOG_generic::K.

Referenced by run().

## cleanup()

void itpp::MOG_diag::cleanup | ( |  | ) |

inline virtual inherited

Release memory used by the model. The model will be empty.

Note
  The likelihood functions are not useable until the model's parameters are re-initialised

Reimplemented from itpp::MOG_generic.

Definition at line 111 of file mog_diag.h.

References itpp::MOG_generic::cleanup(), and free_all_ptrs().

Referenced by itpp::MOG_diag_EM_sup::ml(), itpp::MOG_diag_kmeans_sup::run(), and ~MOG_diag().

## load()

void itpp::MOG_diag::load | ( | const std::string & | name_in | ) |

virtual inherited

Initialise the model by loading the parameters from a model file.

Parameters

  name_in | The model's filename

Note
  If the model file contains a full covariance matrix model, the covariance matrices will be converted to be diagonal after loading.

Reimplemented from itpp::MOG_generic.

Definition at line 277 of file mog_diag.cpp.

References itpp::MOG_generic::convert_to_diag(), itpp::MOG_generic::full, and itpp::MOG_generic::load().

Referenced by MOG_diag().

## convert_to_full()

void itpp::MOG_diag::convert_to_full | ( |  | ) |

inline virtual inherited

Do nothing. Present for compatability with the MOG_generic class.

Reimplemented from itpp::MOG_generic.

Definition at line 121 of file mog_diag.h.

## log_lhood_single_gaus() [1/3]

double itpp::MOG_diag::log_lhood_single_gaus | ( | const double * | c_x_in,
|  | const int | k ) const

inherited

calculate the log likelihood of C vector `c_x_in` using only Gaussian `k`

Definition at line 59 of file mog_diag.cpp.

References itpp::MOG_generic::do_checks, it_assert, itpp::MOG_generic::K, log_lhood_single_gaus_internal(), and itpp::MOG_generic::valid.

## log_lhood_single_gaus() [2/3]

double itpp::MOG_diag::log_lhood_single_gaus | ( | const vec & | x_in,
|  | const int | k ) const

inherited

calculate the log likelihood of IT++ vector `x_in` using only Gaussian `k`

Definition at line 69 of file mog_diag.cpp.

References itpp::MOG_generic::check_size(), itpp::MOG_generic::do_checks, it_assert, itpp::MOG_generic::K, log_lhood_single_gaus_internal(), and itpp::MOG_generic::valid.

## log_lhood_single_gaus() [3/3]

double itpp::MOG_generic::log_lhood_single_gaus | ( | const vec & | x_in,
|  | const int | k )

virtual inherited

calculate the log likelihood of vector `x_in` using only Gaussian `k`

Definition at line 550 of file mog_generic.cpp.

References check_size(), do_checks, it_assert, K, log_lhood_single_gaus_internal(), and valid.

## log_lhood() [1/2]

double itpp::MOG_diag::log_lhood | ( | const double * | c_x_in | ) |

inherited

calculate the log likelihood of C vector `c_x_in`

Definition at line 122 of file mog_diag.cpp.

References itpp::MOG_generic::do_checks, it_assert, log_lhood_internal(), and itpp::MOG_generic::valid.

## log_lhood() [2/2]

double itpp::MOG_diag::log_lhood | ( | const vec & | x_in | ) |

virtual inherited

calculate the log likelihood of IT++ vector `x_in`

Reimplemented from itpp::MOG_generic.

Definition at line 112 of file mog_diag.cpp.

References itpp::MOG_generic::check_size(), itpp::MOG_generic::do_checks, it_assert, log_lhood_internal(), and itpp::MOG_generic::valid.

## lhood() [1/2]

double itpp::MOG_diag::lhood | ( | const double * | c_x_in | ) |

inherited

calculate the likelihood of C vector `c_x_in`

Definition at line 170 of file mog_diag.cpp.

References itpp::MOG_generic::do_checks, it_assert, lhood_internal(), and itpp::MOG_generic::valid.

## lhood() [2/2]

double itpp::MOG_diag::lhood | ( | const vec & | x_in | ) |

virtual inherited

calculate the likelihood of IT++ vector `x_in`

Reimplemented from itpp::MOG_generic.

Definition at line 160 of file mog_diag.cpp.

References itpp::MOG_generic::check_size(), itpp::MOG_generic::do_checks, it_assert, lhood_internal(), and itpp::MOG_generic::valid.

## avg_log_lhood() [1/2]

double itpp::MOG_diag::avg_log_lhood | ( | const double ** | c_x_in,
|  | int | N )

inherited

calculate the average log likelihood of an array of C vectors ( `c_x_in` )

Definition at line 181 of file mog_diag.cpp.

References itpp::MOG_generic::do_checks, it_assert, log_lhood_internal(), and itpp::MOG_generic::valid.

## avg_log_lhood() [2/2]

double itpp::MOG_diag::avg_log_lhood | ( | const Array< vec > & | X_in | ) |

virtual inherited

calculate the average log likelihood of an array of IT++ vectors ( `X_in` )

Reimplemented from itpp::MOG_generic.

Definition at line 195 of file mog_diag.cpp.

References itpp::MOG_generic::check_size(), itpp::MOG_generic::do_checks, it_assert, log_lhood_internal(), itpp::Array< T >::size(), and itpp::MOG_generic::valid.

## setup_means()

void itpp::MOG_diag::setup_means | ( |  | ) |

protected virtual inherited

additional processing of mean vectors, done as the last step of mean initialisation

Reimplemented from itpp::MOG_generic.

Definition at line 231 of file mog_diag.cpp.

References c_means, disable_c_access(), enable_c_access(), itpp::MOG_generic::means, and itpp::MOG_generic::setup_means().

## setup_covs()

void itpp::MOG_diag::setup_covs | ( |  | ) |

protected virtual inherited

additional processing of covariance vectors/matrices, done as the last step of covariance initialisation

Reimplemented from itpp::MOG_generic.

Definition at line 239 of file mog_diag.cpp.

References c_diag_covs, c_diag_covs_inv_etc, c_log_det_etc, itpp::MOG_generic::diag_covs, itpp::MOG_generic::diag_covs_inv_etc, disable_c_access(), enable_c_access(), itpp::MOG_generic::full, itpp::MOG_generic::log_det_etc, and itpp::MOG_generic::setup_covs().

## setup_weights()

void itpp::MOG_diag::setup_weights | ( |  | ) |

protected virtual inherited

additional processing of the weight vector, done as the last step of weight initialisation

Reimplemented from itpp::MOG_generic.

Definition at line 254 of file mog_diag.cpp.

References c_log_weights, c_weights, disable_c_access(), enable_c_access(), itpp::MOG_generic::log_weights, itpp::MOG_generic::setup_weights(), and itpp::MOG_generic::weights.

## setup_misc()

void itpp::MOG_diag::setup_misc | ( |  | ) |

protected virtual inherited

additional processing of miscellaneous parameters, done as the last step of overall initialisation

Reimplemented from itpp::MOG_generic.

Definition at line 266 of file mog_diag.cpp.

References itpp::MOG_generic::convert_to_diag_internal(), disable_c_access(), enable_c_access(), itpp::MOG_generic::full, itpp::MOG_generic::K, and itpp::MOG_generic::setup_misc().

## log_lhood_single_gaus_internal() [1/3]

double itpp::MOG_diag::log_lhood_single_gaus_internal | ( | const double * | c_x_in,
|  | const int | k ) const

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 37 of file mog_diag.cpp.

References c_diag_covs_inv_etc, c_log_det_etc, c_means, and itpp::MOG_generic::D.

Referenced by lhood_internal(), log_lhood_internal(), log_lhood_single_gaus(), log_lhood_single_gaus(), log_lhood_single_gaus_internal(), and itpp::MOG_diag_EM_sup::ml_update_params().

## log_lhood_single_gaus_internal() [2/3]

double itpp::MOG_diag::log_lhood_single_gaus_internal | ( | const vec & | x_in,
|  | const int | k ) const

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 53 of file mog_diag.cpp.

References log_lhood_single_gaus_internal().

## log_lhood_single_gaus_internal() [3/3]

double itpp::MOG_generic::log_lhood_single_gaus_internal | ( | const vec & | x_in,
|  | const int | k )

protected virtual inherited

ADD DOCUMENTATION HERE.

Definition at line 526 of file mog_generic.cpp.

References D, diag_covs_inv_etc, full, full_covs_inv, log_det_etc, itpp::mean(), and means.

Referenced by lhood_internal(), log_lhood_internal(), and log_lhood_single_gaus().

## log_lhood_internal() [1/2]

double itpp::MOG_diag::log_lhood_internal | ( | const double * | c_x_in | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 80 of file mog_diag.cpp.

References c_log_weights, itpp::MOG_generic::K, itpp::log_add(), log_lhood_single_gaus_internal(), itpp::MOG_generic::log_max_K, itpp::MOG_generic::paranoid, and itpp::sum().

Referenced by avg_log_lhood(), avg_log_lhood(), log_lhood(), log_lhood(), and log_lhood_internal().

## log_lhood_internal() [2/2]

double itpp::MOG_diag::log_lhood_internal | ( | const vec & | x_in | ) |

protected virtual inherited

ADD DOCUMENTATION HERE.

Reimplemented from itpp::MOG_generic.

Definition at line 106 of file mog_diag.cpp.

References log_lhood_internal().

## lhood_internal() [1/2]

double itpp::MOG_diag::lhood_internal | ( | const double * | c_x_in | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 133 of file mog_diag.cpp.

References c_log_weights, itpp::MOG_generic::K, itpp::log_add(), log_lhood_single_gaus_internal(), itpp::MOG_generic::log_max_K, itpp::MOG_generic::paranoid, itpp::sum(), and itpp::trunc_exp().

Referenced by lhood(), lhood(), and lhood_internal().

## lhood_internal() [2/2]

double itpp::MOG_diag::lhood_internal | ( | const vec & | x_in | ) |

protected virtual inherited

ADD DOCUMENTATION HERE.

Reimplemented from itpp::MOG_generic.

Definition at line 158 of file mog_diag.cpp.

References lhood_internal().

## enable_c_access() [1/4]

double ** itpp::MOG_diag::enable_c_access | ( | Array< vec > & | A_in | ) |

protected inherited

Enable C style access to an Array of vectors (vec).

Definition at line 284 of file mog_diag.cpp.

References itpp::Array< T >::size().

Referenced by itpp::MOG_diag_EM_sup::ml(), itpp::MOG_diag_kmeans_sup::run(), setup_covs(), setup_means(), setup_misc(), and setup_weights().

## enable_c_access() [2/4]

int ** itpp::MOG_diag::enable_c_access | ( | Array< ivec > & | A_in | ) |

protected inherited

Enable C style access to an Array of vectors (ivec).

Definition at line 292 of file mog_diag.cpp.

References itpp::Array< T >::size().

## enable_c_access() [3/4]

double * itpp::MOG_diag::enable_c_access | ( | vec & | v_in | ) |

protected inherited

Enable C style access to a vector (vec).

Definition at line 303 of file mog_diag.cpp.

## enable_c_access() [4/4]

int * itpp::MOG_diag::enable_c_access | ( | ivec & | v_in | ) |

protected inherited

Enable C style access to a vector (ivec).

Definition at line 304 of file mog_diag.cpp.

## disable_c_access() [1/4]

double ** itpp::MOG_diag::disable_c_access | ( | double ** | A_in | ) |

protected inherited

Disable C style access to an Array of vectors (vec).

Definition at line 300 of file mog_diag.cpp.

Referenced by free_all_ptrs(), itpp::MOG_diag_EM_sup::ml(), itpp::MOG_diag_kmeans_sup::run(), setup_covs(), setup_means(), setup_misc(), and setup_weights().

## disable_c_access() [2/4]

int ** itpp::MOG_diag::disable_c_access | ( | int ** | A_in | ) |

protected inherited

Disable C style access to an Array of vectors (ivec).

Definition at line 301 of file mog_diag.cpp.

## disable_c_access() [3/4]

double * itpp::MOG_diag::disable_c_access | ( | double * | v_in | ) |

protected inherited

Disable C style access to a vector (vec).

Definition at line 306 of file mog_diag.cpp.

## disable_c_access() [4/4]

int * itpp::MOG_diag::disable_c_access | ( | int * | v_in | ) |

protected inherited

Disable C style access to a vector (ivec).

Definition at line 307 of file mog_diag.cpp.

## zero_all_ptrs()

void itpp::MOG_diag::zero_all_ptrs | ( |  | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 207 of file mog_diag.cpp.

References c_diag_covs, c_diag_covs_inv_etc, c_log_det_etc, c_log_weights, c_means, and c_weights.

Referenced by MOG_diag(), MOG_diag(), MOG_diag(), MOG_diag(), MOG_diag(), and MOG_diag().

## free_all_ptrs()

void itpp::MOG_diag::free_all_ptrs | ( |  | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 219 of file mog_diag.cpp.

References c_diag_covs, c_diag_covs_inv_etc, c_log_det_etc, c_log_weights, c_means, c_weights, and disable_c_access().

Referenced by cleanup().

## init() [1/5]

void itpp::MOG_generic::init | ( |  | ) |

inherited

Initialise the model to be empty.

Note
  The likelihood functions are not useable until the model's parameters are set

Definition at line 43 of file mog_generic.cpp.

References cleanup().

Referenced by join(), load(), itpp::MOG_diag_EM_sup::ml(), itpp::MOG_diag::MOG_diag(), itpp::MOG_diag::MOG_diag(), itpp::MOG_diag::MOG_diag(), itpp::MOG_diag::MOG_diag(), itpp::MOG_diag::MOG_diag(), MOG_generic(), MOG_generic(), MOG_generic(), MOG_generic(), MOG_generic(), and itpp::MOG_diag_kmeans_sup::run().

## init() [2/5]

void itpp::MOG_generic::init | ( | const int & | K_in,
|  | const int & | D_in,
|  | bool | full_in = false )

inherited

initialise the model so that all Gaussians have zero mean and unit variance for all dimensions

Parameters

  K_in | Number of Gaussians
  D_in | Dimensionality
  full_in | If true, use full covariance matrices; if false, use diagonal covariance matrices. Default = false.

Definition at line 46 of file mog_generic.cpp.

References D, do_checks, full, it_assert, K, paranoid, set_diag_covs_unity_internal(), set_full_covs_unity_internal(), set_means_zero_internal(), set_weights_uniform_internal(), setup_misc(), and valid.

## init() [3/5]

void itpp::MOG_generic::init | ( | Array< vec > & | means_in,
|  | bool | full_in = false )

inherited

Initialise the model using user supplied mean vectors.

Parameters

  means_in | Array of mean vectors
  full_in | If true, use full covariance matrices; if false, use diagonal covariance matrices. Default = false.

Note
  The number of mean vectors specifies the number of Gaussians. The covariance matrices are set to the identity matrix. The weights for all Gaussians are the same, equal to 1/K, where K is the number of Gaussians

Definition at line 69 of file mog_generic.cpp.

References check_array_uniformity(), D, do_checks, full, it_assert, K, paranoid, set_diag_covs_unity_internal(), set_full_covs_unity_internal(), set_means(), set_weights_uniform_internal(), setup_misc(), itpp::Array< T >::size(), and valid.

## init() [4/5]

void itpp::MOG_generic::init | ( | Array< vec > & | means_in,
|  | Array< vec > & | diag_covs_in,
|  | vec & | weights_in )

inherited

Initialise the model using user supplied parameters (diagonal covariance version).

Parameters

  means_in | Array of mean vectors
  diag_covs_in | Array of vectors representing diagonal covariances
  weights_in | vector of weights

Note
  The number of mean vectors, covariance vectors and weights must be the same

Definition at line 89 of file mog_generic.cpp.

References check_array_uniformity(), D, do_checks, full, it_assert, K, paranoid, set_diag_covs_internal(), set_means_internal(), set_weights_internal(), setup_misc(), itpp::Array< T >::size(), and valid.

## init() [5/5]

void itpp::MOG_generic::init | ( | Array< vec > & | means_in,
|  | Array< mat > & | full_covs_in,
|  | vec & | weights_in )

inherited

Initialise the model using user supplied parameters (full covariance version).

Parameters

  means_in | Array of mean vectors
  full_covs_in | Array of covariance matrices
  weights_in | vector of weights

Note
  The number of mean vectors, covariance matrices and weights must be the same

Definition at line 110 of file mog_generic.cpp.

References check_array_uniformity(), D, do_checks, full, it_assert, K, paranoid, set_full_covs_internal(), set_means_internal(), set_weights_internal(), setup_misc(), itpp::Array< T >::size(), and valid.

## is_valid()

bool itpp::MOG_generic::is_valid | ( |  | ) | const

inline inherited

Returns true if the model's parameters are valid.

Definition at line 154 of file mog_generic.h.

References valid.

Referenced by join(), itpp::MOG_diag_EM_sup::ml(), and itpp::MOG_diag_kmeans_sup::run().

## is_full()

bool itpp::MOG_generic::is_full | ( |  | ) | const

inline inherited

Returns true if the model has full covariance matrices.

Definition at line 157 of file mog_generic.h.

References full.

Referenced by join().

## get_K()

int itpp::MOG_generic::get_K | ( |  | ) | const

inline inherited

Return the number of Gaussians.

Definition at line 160 of file mog_generic.h.

References K, and valid.

Referenced by join().

## get_D()

int itpp::MOG_generic::get_D | ( |  | ) | const

inline inherited

Return the dimensionality.

Definition at line 163 of file mog_generic.h.

References D, and valid.

Referenced by join().

## get_weights()

vec itpp::MOG_generic::get_weights | ( |  | ) | const

inline inherited

Obtain a copy of the weight vector.

Definition at line 166 of file mog_generic.h.

References valid, and weights.

Referenced by join(), itpp::MOG_diag_EM_sup::ml(), and itpp::MOG_diag_kmeans_sup::run().

## get_means()

Array< vec > itpp::MOG_generic::get_means | ( |  | ) | const

inline inherited

Obtain a copy of the array of mean vectors.

Definition at line 169 of file mog_generic.h.

References means, and valid.

Referenced by join(), itpp::MOG_diag_EM_sup::ml(), and itpp::MOG_diag_kmeans_sup::run().

## get_diag_covs()

Array< vec > itpp::MOG_generic::get_diag_covs | ( |  | ) | const

inline inherited

Obtain a copy of the array of diagonal covariance vectors.

Definition at line 172 of file mog_generic.h.

References diag_covs, full, and valid.

Referenced by join(), itpp::MOG_diag_EM_sup::ml(), and itpp::MOG_diag_kmeans_sup::run().

## get_full_covs()

Array< mat > itpp::MOG_generic::get_full_covs | ( |  | ) | const

inline inherited

Obtain a copy of the array of full covariance matrices.

Definition at line 175 of file mog_generic.h.

References full, full_covs, and valid.

Referenced by join().

## set_means()

void itpp::MOG_generic::set_means | ( | Array< vec > & | means_in | ) |

inherited

Set the means of the model.

Note
  The number of means must match the number of Gaussians in the model

Definition at line 351 of file mog_generic.cpp.

References set_means_internal(), and valid.

Referenced by init().

## set_diag_covs()

void itpp::MOG_generic::set_diag_covs | ( | Array< vec > & | diag_covs_in | ) |

inherited

Set the diagonal covariance vectors of the model.

Note
  The number of diagonal covariance vectors must match the number of Gaussians in the model

Definition at line 365 of file mog_generic.cpp.

References set_diag_covs_internal(), and valid.

## set_full_covs()

void itpp::MOG_generic::set_full_covs | ( | Array< mat > & | full_covs_in | ) |

inherited

Set the full covariance matrices of the model.

Note
  The number of covariance matrices must match the number of Gaussians in the model

Definition at line 372 of file mog_generic.cpp.

References set_full_covs_internal(), and valid.

## set_weights()

void itpp::MOG_generic::set_weights | ( | vec & | weights_in | ) |

inherited

Set the weight vector of the model.

Note
  The number of elements in the weight vector must match the number of Gaussians in the model

Definition at line 379 of file mog_generic.cpp.

References set_weights_internal(), and valid.

## set_means_zero()

void itpp::MOG_generic::set_means_zero | ( |  | ) |

inherited

Set the means in the model to be zero.

Definition at line 358 of file mog_generic.cpp.

References set_means_zero_internal(), and valid.

## set_diag_covs_unity()

void itpp::MOG_generic::set_diag_covs_unity | ( |  | ) |

inherited

Set the diagonal covariance vectors to be unity.

Definition at line 386 of file mog_generic.cpp.

References set_diag_covs_unity_internal(), and valid.

## set_full_covs_unity()

void itpp::MOG_generic::set_full_covs_unity | ( |  | ) |

inherited

Set the full covariance matrices to be unity.

Definition at line 393 of file mog_generic.cpp.

References set_full_covs_unity_internal(), and valid.

## set_weights_uniform()

void itpp::MOG_generic::set_weights_uniform | ( |  | ) |

inherited

Set all the weights to 1/K, where K is the number of Gaussians.

Definition at line 400 of file mog_generic.cpp.

References set_weights_uniform_internal(), and valid.

## set_checks()

void itpp::MOG_generic::set_checks | ( | bool | do_checks_in | ) |

inline inherited

Enable/disable internal checks for likelihood functions.

Parameters

  do_checks_in | If true, checks are enabled; if false, checks are disabled

Note
  Disabling checks will provide a speedup in the likelihood functions. Disable them only when you're happy that everything is working correctly.

Definition at line 214 of file mog_generic.h.

References do_checks.

## set_paranoid()

void itpp::MOG_generic::set_paranoid | ( | bool | paranoid_in | ) |

inline inherited

Enable/disable paranoia about numerical stability.

Parameters

  paranoid_in | If true, calculate likelihoods using a safer, but slower method.

Definition at line 219 of file mog_generic.h.

References paranoid.

## save()

void itpp::MOG_generic::save | ( | const std::string & | name_in | ) | const

virtual inherited

Save the model's parameters to a model file.

Parameters

  name_in | The model's filename

Definition at line 438 of file mog_generic.cpp.

References itpp::it_file::close(), diag_covs, full, full_covs, means, valid, and weights.

## join()

void itpp::MOG_generic::join | ( | const MOG_generic & | B_in | ) |

virtual inherited

Mathematically join the model with a user supplied model.

Parameters

  B_in | user supplied model

Note
  The Arrays of mean vectors and covariance vectors/matrices from the two models are simply concatenated, while the weights of the resultant model are a function of the original weights and numbers of Gaussians from both models. Specifically, , where is the new weight vector, and are the weight vectors from model A and B, while and . In turn, and are the numbers of Gaussians in model A and B, respectively.

See On transforming statistical models... for more information.

Definition at line 453 of file mog_generic.cpp.

References itpp::concat(), D, diag_covs, full, full_covs, get_D(), get_diag_covs(), get_full_covs(), get_K(), get_means(), get_weights(), init(), is_full(), is_valid(), it_assert, K, means, MOG_generic(), valid, and weights.

## convert_to_diag()

void itpp::MOG_generic::convert_to_diag | ( |  | ) |

virtual inherited

Convert the model to use diagonal covariances.

Note
  If the model is already diagonal, nothing is done. If the model has full covariance matrices, this results in irreversible information loss (in effect the off-diagonal covariance elements are now zero)

Definition at line 499 of file mog_generic.cpp.

References convert_to_diag_internal(), and valid.

Referenced by itpp::MOG_diag::load(), and itpp::MOG_diag::MOG_diag().

## check_size() [1/2]

bool itpp::MOG_generic::check_size | ( | const vec & | x_in | ) | const

protected inherited

Check if vector `x_in` has the same dimensionality as the model.

Definition at line 130 of file mog_generic.cpp.

References D.

Referenced by itpp::MOG_diag::avg_log_lhood(), avg_log_lhood(), check_size(), itpp::MOG_diag::lhood(), lhood(), itpp::MOG_diag::log_lhood(), log_lhood(), itpp::MOG_diag::log_lhood_single_gaus(), log_lhood_single_gaus(), and itpp::MOG_diag_kmeans_sup::run().

## check_size() [2/2]

bool itpp::MOG_generic::check_size | ( | const Array< vec > & | X_in | ) | const

protected inherited

Check if all vectors in Array `X_in` have the same dimensionality as the model.

Definition at line 137 of file mog_generic.cpp.

References check_array_uniformity(), and check_size().

## check_array_uniformity()

bool itpp::MOG_generic::check_array_uniformity | ( | const Array< vec > & | A | ) | const

protected inherited

Check if all vectors in Array `X_in` have the same dimensionality.

Definition at line 144 of file mog_generic.cpp.

References itpp::Array< T >::size(), and itpp::size().

Referenced by check_size(), init(), init(), init(), and itpp::MOG_diag_EM_sup::ml().

## set_means_internal()

void itpp::MOG_generic::set_means_internal | ( | Array< vec > & | means_in | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 164 of file mog_generic.cpp.

References D, it_assert, K, means, setup_means(), itpp::Array< T >::size(), and itpp::size().

Referenced by init(), init(), and set_means().

## set_diag_covs_internal()

void itpp::MOG_generic::set_diag_covs_internal | ( | Array< vec > & | diag_covs_in | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 180 of file mog_generic.cpp.

References D, diag_covs, full, full_covs, it_assert, K, setup_covs(), itpp::Array< T >::size(), and itpp::size().

Referenced by init(), and set_diag_covs().

## set_full_covs_internal()

void itpp::MOG_generic::set_full_covs_internal | ( | Array< mat > & | full_covs_in | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 200 of file mog_generic.cpp.

References D, diag_covs, full, full_covs, it_assert, K, setup_covs(), and itpp::Array< T >::size().

Referenced by init(), and set_full_covs().

## set_weights_internal()

void itpp::MOG_generic::set_weights_internal | ( | vec & | _weigths | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 225 of file mog_generic.cpp.

References it_assert, K, setup_weights(), and weights.

Referenced by init(), init(), and set_weights().

## set_means_zero_internal()

void itpp::MOG_generic::set_means_zero_internal | ( |  | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 156 of file mog_generic.cpp.

References D, K, means, itpp::Array< T >::set_size(), and setup_means().

Referenced by init(), and set_means_zero().

## set_diag_covs_unity_internal()

void itpp::MOG_generic::set_diag_covs_unity_internal | ( |  | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 241 of file mog_generic.cpp.

References D, diag_covs, full, full_covs, K, itpp::Array< T >::set_size(), and setup_covs().

Referenced by init(), init(), and set_diag_covs_unity().

## set_full_covs_unity_internal()

void itpp::MOG_generic::set_full_covs_unity_internal | ( |  | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 253 of file mog_generic.cpp.

References D, diag_covs, full, full_covs, K, itpp::Array< T >::set_size(), and setup_covs().

Referenced by init(), init(), and set_full_covs_unity().

## set_weights_uniform_internal()

void itpp::MOG_generic::set_weights_uniform_internal | ( |  | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 269 of file mog_generic.cpp.

References K, setup_weights(), and weights.

Referenced by init(), init(), and set_weights_uniform().

## convert_to_diag_internal()

void itpp::MOG_generic::convert_to_diag_internal | ( |  | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 486 of file mog_generic.cpp.

References itpp::diag(), diag_covs, full, full_covs, K, and setup_covs().

Referenced by convert_to_diag(), and itpp::MOG_diag::setup_misc().

## convert_to_full_internal()

void itpp::MOG_generic::convert_to_full_internal | ( |  | ) |

protected inherited

ADD DOCUMENTATION HERE.

Definition at line 506 of file mog_generic.cpp.

References itpp::diag(), diag_covs, full, full_covs, K, and setup_covs().

Referenced by convert_to_full().

## Member Data Documentation

## max_iter

int itpp::MOG_diag_kmeans_sup::max_iter

protected

Maximum number of iterations.

Definition at line 87 of file mog_diag_kmeans.h.

Referenced by iterate(), and run().

## trust

double itpp::MOG_diag_kmeans_sup::trust

protected

trust factor, where 0 <= trust <= 1.

Note
  The higher the trust factor, the more we trust the estimates of covariance matrices and weights.

Definition at line 92 of file mog_diag_kmeans.h.

Referenced by calc_covs(), calc_weights(), and run().

## verbose

bool itpp::MOG_diag_kmeans_sup::verbose

protected

Whether we print the progress.

Definition at line 95 of file mog_diag_kmeans.h.

Referenced by dezombify_means(), iterate(), MOG_diag_kmeans_sup(), and run().

## N

int itpp::MOG_diag_kmeans_sup::N

protected

number of training vectors

Definition at line 98 of file mog_diag_kmeans.h.

Referenced by assign_to_means(), calc_weights(), initial_means(), normalise_vectors(), run(), and unnormalise_vectors().

## c_X

double** itpp::MOG_diag_kmeans_sup::c_X

protected

'C' pointers to training vectors

Definition at line 101 of file mog_diag_kmeans.h.

Referenced by assign_to_means(), calc_covs(), dezombify_means(), initial_means(), normalise_vectors(), recalculate_means(), run(), and unnormalise_vectors().

## means_old

Array<vec> itpp::MOG_diag_kmeans_sup::means_old

protected

means from the previous iteration, used to measure progress

Definition at line 104 of file mog_diag_kmeans.h.

Referenced by run().

## c_means_old

double** itpp::MOG_diag_kmeans_sup::c_means_old

protected

'C' pointers to old means

Definition at line 107 of file mog_diag_kmeans.h.

Referenced by iterate(), measure_change(), and run().

## partitions

Array<ivec> itpp::MOG_diag_kmeans_sup::partitions

protected

contains indices of vectors assigned to each mean

Definition at line 110 of file mog_diag_kmeans.h.

Referenced by run().

## c_partitions

int** itpp::MOG_diag_kmeans_sup::c_partitions

protected

'C' pointers to partition vectors

Definition at line 113 of file mog_diag_kmeans.h.

Referenced by assign_to_means(), calc_covs(), dezombify_means(), recalculate_means(), and run().

## count

ivec itpp::MOG_diag_kmeans_sup::count

protected

keeps a count of the number of vectors assigned to each mean

Definition at line 116 of file mog_diag_kmeans.h.

Referenced by assign_to_means(), dezombify_means(), and run().

## c_count

int* itpp::MOG_diag_kmeans_sup::c_count

protected

'C' pointer to the count vector

Definition at line 119 of file mog_diag_kmeans.h.

Referenced by assign_to_means(), calc_covs(), calc_weights(), dezombify_means(), recalculate_means(), and run().

## c_means

double** itpp::MOG_diag::c_means

protected inherited

pointers to the mean vectors

Definition at line 197 of file mog_diag.h.

Referenced by itpp::MOG_diag_kmeans_sup::assign_to_means(), itpp::MOG_diag_kmeans_sup::calc_covs(), itpp::MOG_diag_kmeans_sup::dezombify_means(), free_all_ptrs(), itpp::MOG_diag_kmeans_sup::initial_means(), itpp::MOG_diag_kmeans_sup::iterate(), log_lhood_single_gaus_internal(), itpp::MOG_diag_kmeans_sup::measure_change(), itpp::MOG_diag_EM_sup::ml_update_params(), itpp::MOG_diag_kmeans_sup::recalculate_means(), setup_means(), itpp::MOG_diag_kmeans_sup::unnormalise_means(), and zero_all_ptrs().

## c_diag_covs

double** itpp::MOG_diag::c_diag_covs

protected inherited

pointers to the covariance vectors

Definition at line 200 of file mog_diag.h.

Referenced by itpp::MOG_diag_kmeans_sup::calc_covs(), free_all_ptrs(), itpp::MOG_diag_EM_sup::ml_update_params(), itpp::MOG_diag_EM_sup::sanitise_params(), setup_covs(), itpp::MOG_diag_EM_sup::update_internals(), and zero_all_ptrs().

## c_diag_covs_inv_etc

double** itpp::MOG_diag::c_diag_covs_inv_etc

protected inherited

pointers to the inverted covariance vectors

Definition at line 203 of file mog_diag.h.

Referenced by free_all_ptrs(), log_lhood_single_gaus_internal(), setup_covs(), itpp::MOG_diag_EM_sup::update_internals(), and zero_all_ptrs().

## c_weights

double* itpp::MOG_diag::c_weights

protected inherited

pointer to the weight vector

Definition at line 206 of file mog_diag.h.

Referenced by itpp::MOG_diag_kmeans_sup::calc_weights(), free_all_ptrs(), itpp::MOG_diag_EM_sup::ml_update_params(), itpp::MOG_diag_EM_sup::sanitise_params(), setup_weights(), itpp::MOG_diag_EM_sup::update_internals(), and zero_all_ptrs().

## c_log_weights

double* itpp::MOG_diag::c_log_weights

protected inherited

pointer to the log version of the weight vector

Definition at line 209 of file mog_diag.h.

Referenced by free_all_ptrs(), lhood_internal(), log_lhood_internal(), itpp::MOG_diag_EM_sup::ml_update_params(), setup_weights(), itpp::MOG_diag_EM_sup::update_internals(), and zero_all_ptrs().

## c_log_det_etc

double* itpp::MOG_diag::c_log_det_etc

protected inherited

pointer to the log_det_etc vector

Definition at line 212 of file mog_diag.h.

Referenced by free_all_ptrs(), log_lhood_single_gaus_internal(), setup_covs(), itpp::MOG_diag_EM_sup::update_internals(), and zero_all_ptrs().

## do_checks

bool itpp::MOG_generic::do_checks

protected inherited

indicates whether checks on input data are done

Definition at line 280 of file mog_generic.h.

Referenced by itpp::MOG_diag::avg_log_lhood(), itpp::MOG_diag::avg_log_lhood(), avg_log_lhood(), cleanup(), init(), init(), init(), init(), itpp::MOG_diag::lhood(), itpp::MOG_diag::lhood(), lhood(), itpp::MOG_diag::log_lhood(), itpp::MOG_diag::log_lhood(), log_lhood(), itpp::MOG_diag::log_lhood_single_gaus(), itpp::MOG_diag::log_lhood_single_gaus(), log_lhood_single_gaus(), and set_checks().

## valid

bool itpp::MOG_generic::valid

protected inherited

indicates whether the parameters are valid

Definition at line 283 of file mog_generic.h.

Referenced by itpp::MOG_diag::avg_log_lhood(), itpp::MOG_diag::avg_log_lhood(), avg_log_lhood(), cleanup(), convert_to_diag(), convert_to_full(), get_D(), get_diag_covs(), get_full_covs(), get_K(), get_means(), get_weights(), init(), init(), init(), init(), is_valid(), join(), itpp::MOG_diag::lhood(), itpp::MOG_diag::lhood(), lhood(), load(), itpp::MOG_diag::log_lhood(), itpp::MOG_diag::log_lhood(), log_lhood(), itpp::MOG_diag::log_lhood_single_gaus(), itpp::MOG_diag::log_lhood_single_gaus(), log_lhood_single_gaus(), save(), set_diag_covs(), set_diag_covs_unity(), set_full_covs(), set_full_covs_unity(), set_means(), set_means_zero(), set_weights(), and set_weights_uniform().

## full

bool itpp::MOG_generic::full

protected inherited

indicates whether we are using full or diagonal covariance matrices

Definition at line 286 of file mog_generic.h.

Referenced by convert_to_diag_internal(), convert_to_full_internal(), get_diag_covs(), get_full_covs(), init(), init(), init(), init(), is_full(), join(), itpp::MOG_diag::load(), log_lhood_single_gaus_internal(), save(), set_diag_covs_internal(), set_diag_covs_unity_internal(), set_full_covs_internal(), set_full_covs_unity_internal(), itpp::MOG_diag::setup_covs(), setup_covs(), and itpp::MOG_diag::setup_misc().

## paranoid

bool itpp::MOG_generic::paranoid

protected inherited

indicates whether we are paranoid about numerical stability

Definition at line 289 of file mog_generic.h.

Referenced by init(), init(), init(), init(), itpp::MOG_diag::lhood_internal(), lhood_internal(), itpp::MOG_diag::log_lhood_internal(), log_lhood_internal(), itpp::MOG_diag_EM_sup::ml_update_params(), and set_paranoid().

## K

int itpp::MOG_generic::K

protected inherited

number of gaussians

Definition at line 292 of file mog_generic.h.

Referenced by itpp::MOG_diag_kmeans_sup::assign_to_means(), itpp::MOG_diag_kmeans_sup::calc_covs(), itpp::MOG_diag_kmeans_sup::calc_weights(), cleanup(), convert_to_diag_internal(), convert_to_full_internal(), itpp::MOG_diag_kmeans_sup::dezombify_means(), get_K(), init(), init(), init(), init(), itpp::MOG_diag_kmeans_sup::initial_means(), itpp::MOG_diag_kmeans_sup::iterate(), join(), itpp::MOG_diag::lhood_internal(), lhood_internal(), itpp::MOG_diag::log_lhood_internal(), log_lhood_internal(), itpp::MOG_diag::log_lhood_single_gaus(), itpp::MOG_diag::log_lhood_single_gaus(), log_lhood_single_gaus(), itpp::MOG_diag_kmeans_sup::measure_change(), itpp::MOG_diag_EM_sup::ml(), itpp::MOG_diag_EM_sup::ml_update_params(), itpp::MOG_diag_kmeans_sup::recalculate_means(), itpp::MOG_diag_kmeans_sup::run(), itpp::MOG_diag_EM_sup::sanitise_params(), set_diag_covs_internal(), set_diag_covs_unity_internal(), set_full_covs_internal(), set_full_covs_unity_internal(), set_means_internal(), set_means_zero_internal(), set_weights_internal(), set_weights_uniform_internal(), setup_covs(), itpp::MOG_diag::setup_misc(), setup_misc(), itpp::MOG_diag_kmeans_sup::unnormalise_means(), and itpp::MOG_diag_EM_sup::update_internals().

## D

int itpp::MOG_generic::D

protected inherited

dimensionality

Definition at line 295 of file mog_generic.h.

Referenced by itpp::MOG_diag_kmeans_sup::calc_covs(), check_size(), cleanup(), itpp::MOG_diag_kmeans_sup::dezombify_means(), itpp::MOG_diag_kmeans_sup::dist(), get_D(), init(), init(), init(), init(), itpp::MOG_diag_kmeans_sup::initial_means(), itpp::MOG_diag_kmeans_sup::iterate(), join(), itpp::MOG_diag::log_lhood_single_gaus_internal(), log_lhood_single_gaus_internal(), itpp::MOG_diag_EM_sup::ml(), itpp::MOG_diag_EM_sup::ml_update_params(), itpp::MOG_diag_kmeans_sup::normalise_vectors(), itpp::MOG_diag_kmeans_sup::recalculate_means(), itpp::MOG_diag_kmeans_sup::run(), itpp::MOG_diag_EM_sup::sanitise_params(), set_diag_covs_internal(), set_diag_covs_unity_internal(), set_full_covs_internal(), set_full_covs_unity_internal(), set_means_internal(), set_means_zero_internal(), setup_covs(), setup_misc(), itpp::MOG_diag_kmeans_sup::unnormalise_means(), itpp::MOG_diag_kmeans_sup::unnormalise_vectors(), and itpp::MOG_diag_EM_sup::update_internals().

## means

Array<vec> itpp::MOG_generic::means

protected inherited

means

Definition at line 298 of file mog_generic.h.

Referenced by cleanup(), get_means(), join(), log_lhood_single_gaus_internal(), itpp::MOG_diag_EM_sup::ml(), itpp::MOG_diag_kmeans_sup::run(), save(), set_means_internal(), set_means_zero_internal(), and itpp::MOG_diag::setup_means().

## diag_covs

Array<vec> itpp::MOG_generic::diag_covs

protected inherited

diagonal covariance matrices, stored as vectors

Definition at line 301 of file mog_generic.h.

Referenced by cleanup(), convert_to_diag_internal(), convert_to_full_internal(), get_diag_covs(), join(), itpp::MOG_diag_EM_sup::ml(), itpp::MOG_diag_kmeans_sup::run(), save(), set_diag_covs_internal(), set_diag_covs_unity_internal(), set_full_covs_internal(), set_full_covs_unity_internal(), itpp::MOG_diag::setup_covs(), and setup_covs().

## full_covs

Array<mat> itpp::MOG_generic::full_covs

protected inherited

full covariance matrices

Definition at line 304 of file mog_generic.h.

Referenced by cleanup(), convert_to_diag_internal(), convert_to_full_internal(), get_full_covs(), join(), save(), set_diag_covs_internal(), set_diag_covs_unity_internal(), set_full_covs_internal(), set_full_covs_unity_internal(), and setup_covs().

## weights

vec itpp::MOG_generic::weights

protected inherited

weights

Definition at line 307 of file mog_generic.h.

Referenced by cleanup(), get_weights(), join(), itpp::MOG_diag_EM_sup::ml(), itpp::MOG_diag_kmeans_sup::run(), save(), set_weights_internal(), set_weights_uniform_internal(), itpp::MOG_diag::setup_weights(), and setup_weights().

## log_max_K

double itpp::MOG_generic::log_max_K

protected inherited

Pre-calcualted std::log(std::numeric_limits<double>::max() / K), where K is the number of Gaussians.

Definition at line 310 of file mog_generic.h.

Referenced by itpp::MOG_diag::lhood_internal(), lhood_internal(), itpp::MOG_diag::log_lhood_internal(), log_lhood_internal(), itpp::MOG_diag_EM_sup::ml_update_params(), and setup_misc().

## log_det_etc

vec itpp::MOG_generic::log_det_etc

protected inherited

Gaussian specific pre-calcualted constants.

Note
  Vector of pre-calculated for each Gaussian, where is the dimensionality and is the determinant for the Gaussian's covariance matrix .

Definition at line 317 of file mog_generic.h.

Referenced by cleanup(), log_lhood_single_gaus_internal(), itpp::MOG_diag::setup_covs(), and setup_covs().

## log_weights

vec itpp::MOG_generic::log_weights

protected inherited

Pre-calculated log versions of the weights.

Definition at line 320 of file mog_generic.h.

Referenced by cleanup(), lhood_internal(), log_lhood_internal(), itpp::MOG_diag::setup_weights(), and setup_weights().

## full_covs_inv

Array<mat> itpp::MOG_generic::full_covs_inv

protected inherited

Pre-calcuated inverted version of each full covariance matrix.

Definition at line 323 of file mog_generic.h.

Referenced by cleanup(), log_lhood_single_gaus_internal(), and setup_covs().

## diag_covs_inv_etc

Array<vec> itpp::MOG_generic::diag_covs_inv_etc

protected inherited

Pre-calcuated inverted version of each diagonal covariance vector, where the covariance elements are first multiplied by two.

Definition at line 326 of file mog_generic.h.

Referenced by cleanup(), log_lhood_single_gaus_internal(), itpp::MOG_diag::setup_covs(), and setup_covs().

The documentation for this class was generated from the following files:

- itpp/stat/mog_diag_kmeans.h
- itpp/stat/mog_diag_kmeans.cpp

Generated on for IT++ by Doxygen 1.15.0