-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGMM.h
33 lines (33 loc) · 823 Bytes
/
GMM.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef _GMM_H
#define _GMM_H
#include "Eigen/Dense"
#include <vector>
using Eigen::MatrixXd;
class GMM{
private:
bool* mpbIsModelValid;
bool mbIsFirstRun;
std::vector<float> mpfInputData;
std::vector<float> mpfWeights;
int mnNumOfInputs;
int mnDimension;
int mnK;
float* mpfDeterminants;
float* mpfMeanVector;
MatrixXd* mpfCovVectors;
MatrixXd* mpfInvCovVectors;
float getLikelihood(int inputId,int modelId);
float* normSumK;
public:
GMM();
GMM(int dimension,int k);
bool initializeAndClear(int dimension,int k);
void insertData(float* inVector,int inSize);
void clear();
void iterateGMM(int numIter);
float getLikelihood(float* inputVec);
float getLikelihood2(float* inputVec);
void printModels();
void initLastMean();
};
#endif