forked from jacquelineCelia/hdphmm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gmm.h
66 lines (60 loc) · 1.71 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* -*- C++ -*-
*
* Copyright (c) 2014
* Spoken Language Systems Group
* MIT Computer Science and Artificial Intelligence Laboratory
* Massachusetts Institute of Technology
*
* All Rights Reserved
./gmm.h
* FILE: cluster.cc *
* *
* *
* Chia-ying (Jackie) Lee <[email protected]> *
* Feb 2014 *
*********************************************************************/
#ifndef GMM_H
#define GMM_H
#include <vector>
#include <fstream>
#include <iostream>
#include "config.h"
#include "mixture.h"
#include "toolkit.h"
using namespace std;
class GMM{
public:
GMM(Config*);
GMM(const GMM&);
GMM(Config*, int);
GMM& operator= (const GMM&);
GMM& operator+= (GMM&);
vector<Mixture> mixtures() const {return _mixtures;}
Mixture& mixture(int index) {return _mixtures[index];}
Config* config() const {return _config;}
int mix_num() const {return _mix_num;}
float ComputeLikehood(float*);
float ComputeLikehood(int);
vector<float> ComponentLikelihood(float*);
vector<float> ComponentLikelihood(int);
vector<float> weight() const {return _weight;}
void set_mixture(Mixture&, int);
void set_mixtures(vector<Mixture>& mixtures);
void set_weight(vector<float> wegith);
void Minus(float*, int);
void Plus(float*, int);
void PreCompute(float**, int);
void ComputeLikehood(vector<float*>, float*);
void ComputeLikehood(int, int, float*);
void Save(ofstream&);
void Load(ifstream&);
~GMM();
private:
// Weight stored in Log
vector<float> _weight;
vector<Mixture> _mixtures;
int _mix_num;
ToolKit _toolkit;
Config* _config;
};
#endif