-
Notifications
You must be signed in to change notification settings - Fork 8
/
phndec.h
56 lines (51 loc) · 1.14 KB
/
phndec.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
#ifndef PHNDEC_H
#define PHNDEC_H
#include "decoder.h"
#include <string>
#include "matrix.h"
class PhnDec : public Decoder
{
protected:
struct LabelRec
{
int mPhn;
int mStart;
int mEnd;
float mLike;
};
Mat<float> mAlphas;
Mat<int> mPrevPhn;
Mat<int> mPhnLen;
Mat<int> mHistoryPhn;
Mat<int> mHistoryLen;
Mat<float> mHistoryAlphas;
Mat<int> mPdfIndexes;
float mPrevAlpha;
int mpHistory;
int mTimePruning;
int mNFrames;
float mLogTrCurr;
float mLogTrNext;
int mNPhonemes;
std::string *mpPhonemes;
int mNStPerPhn;
FILE *mpLabFP;
void PropagateInModels(float *pFrame);
void PropagateInNetwork();
void AddHistory(int phnIdx, int len, float alpha);
void GetBestToken(int *pPrevPhn, int *pLen);
void TimePruning();
void CreatePdfIndexes();
public:
PhnDec();
~PhnDec();
int Init(char *pLabelFile = 0);
void ProcessFrame(float *pFrame);
float Done();
int LoadPhnList(char *pList);
void SetMode(int m);
void SetNStPerPhn(int n) {mNStPerPhn = n;}
void SetCurrTrProb(float prob);
void SetTimePruning(int n){mTimePruning = n;}
};
#endif