35 #include <itpp/itexports.h>
79 MOG_generic(
const int &K_in,
const int &D_in,
bool full_in =
false) { init(K_in, D_in, full_in); }
120 void init(
const int &K_in,
const int &D_in,
bool full_in =
false);
129 void init(
Array<vec> &means_in,
bool full_in =
false);
151 virtual void cleanup();
160 int get_K()
const {
if (valid)
return(K);
else return(0); }
163 int get_D()
const {
if (valid)
return(D);
else return(0); }
166 vec
get_weights()
const { vec tmp;
if (valid) { tmp = weights; }
return tmp; }
195 void set_weights(vec &weights_in);
198 void set_means_zero();
201 void set_diag_covs_unity();
204 void set_full_covs_unity();
207 void set_weights_uniform();
214 void set_checks(
bool do_checks_in) { do_checks = do_checks_in; }
224 virtual void load(
const std::string &name_in);
229 virtual void save(
const std::string &name_in)
const;
256 virtual void convert_to_diag();
263 virtual void convert_to_full();
266 virtual double log_lhood_single_gaus(
const vec &x_in,
const int k);
269 virtual double log_lhood(
const vec &x_in);
272 virtual double lhood(
const vec &x_in);
275 virtual double avg_log_lhood(
const Array<vec> &X_in);
329 bool check_size(
const vec &x_in)
const;
332 bool check_size(
const Array<vec> &X_in)
const;
335 bool check_array_uniformity(
const Array<vec> & A)
const;
338 void set_means_internal(
Array<vec> &means_in);
340 void set_diag_covs_internal(
Array<vec> &diag_covs_in);
342 void set_full_covs_internal(
Array<mat> &full_covs_in);
344 void set_weights_internal(vec &_weigths);
347 void set_means_zero_internal();
349 void set_diag_covs_unity_internal();
351 void set_full_covs_unity_internal();
353 void set_weights_uniform_internal();
356 void convert_to_diag_internal();
358 void convert_to_full_internal();
361 virtual void setup_means();
364 virtual void setup_covs();
367 virtual void setup_weights();
370 virtual void setup_misc();
373 virtual double log_lhood_single_gaus_internal(
const vec &x_in,
const int k);
375 virtual double log_lhood_internal(
const vec &x_in);
377 virtual double lhood_internal(
const vec &x_in);
387 #endif // #ifndef MOG_GENERIC_H