33 #include <itpp/itexports.h> 70 MOG_diag(
const std::string &name) { zero_all_ptrs(); load(name); }
77 MOG_diag(
const int &K_in,
const int &D_in,
bool full_in =
false) { zero_all_ptrs(); init(K_in, D_in, full_in); }
102 MOG_diag(
Array<vec> &means_in,
Array<mat> &full_covs_in, vec &weights_in) { zero_all_ptrs(); init(means_in, full_covs_in, weights_in); convert_to_diag(); }
118 void load(
const std::string &name_in);
124 double log_lhood_single_gaus(
const double * c_x_in,
const int k)
const;
127 double log_lhood_single_gaus(
const vec &x_in,
const int k)
const;
130 double log_lhood(
const double * c_x_in);
133 double log_lhood(
const vec &x_in);
136 double lhood(
const double * c_x_in);
139 double lhood(
const vec &x_in);
142 double avg_log_lhood(
const double ** c_x_in,
int N);
145 double avg_log_lhood(
const Array<vec> & X_in);
151 void setup_weights();
155 double log_lhood_single_gaus_internal(
const double * c_x_in,
const int k)
const;
157 double log_lhood_single_gaus_internal(
const vec &x_in,
const int k)
const;
159 double log_lhood_internal(
const double * c_x_in);
161 double log_lhood_internal(
const vec &x_in);
163 double lhood_internal(
const double * c_x_in);
165 double lhood_internal(
const vec &x_in);
174 double * enable_c_access(vec & v_in);
177 int * enable_c_access(ivec & v_in);
180 double ** disable_c_access(
double ** A_in);
183 int ** disable_c_access(
int ** A_in);
186 double * disable_c_access(
double * v_in);
189 int * disable_c_access(
int * v_in);
192 void zero_all_ptrs();
194 void free_all_ptrs();
223 #endif // #ifndef MOG_DIAG_H ~MOG_diag()
Default destructor.
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
Generic Mixture of Gaussians (MOG) class - header file.
double ** c_diag_covs
pointers to the covariance vectors
MOG_diag(Array< vec > &means_in, Array< mat > &full_covs_in, vec &weights_in)
Construct a model using user supplied parameters (full covariance version)
MOG_diag(const std::string &name)
Construct the MOG_diag object by loading the parameters from a model file.
double ** c_means
pointers to the mean vectors
Diagonal Mixture of Gaussians (MOG) class.
MOG_diag(Array< vec > &means_in, Array< vec > &diag_covs_in, vec &weights_in)
Construct a model using user supplied parameters (diagonal covariance version)
Generic Mixture of Gaussians (MOG) class. Used as a base for other MOG classes.
MOG_diag(const int &K_in, const int &D_in, bool full_in=false)
construct a default model (all Gaussians have zero mean and unit variance for all dimensions) ...
void cleanup()
Release memory used by the model. The model will be empty.
double ** c_diag_covs_inv_etc
pointers to the inverted covariance vectors
double * c_weights
pointer to the weight vector
MOG_diag(Array< vec > &means_in, bool)
Construct a model using user supplied mean vectors.
virtual void cleanup()
Release memory used by the model. The model will be empty.
void convert_to_full()
Do nothing. Present for compatability with the MOG_generic class.
MOG_diag()
Default constructor.