我在 Hidden Markov Model (HMM) 中阅读了这个问题 3-state phone model
我明白三态是什么意思,但仍然不明白为什么转换矩阵用 (state+2)*(state+2) 矩阵。
这就是我得到的。我有关于 21 部手机的数据。
#define N_STATE 3
#define N_PDF 10
#define N_DIMENSION 39
typedef struct {
float weight;
float mean[N_DIMENSION];
float var[N_DIMENSION];
} pdfType;
typedef struct {
pdfType pdf[N_PDF];
} stateType;
typedef struct {
char *name;
float tp[N_STATE+2][N_STATE+2];
stateType state[N_STATE];
} hmmType;
hmmType phones[] = {
{ "f", // HMM
{ // transition probability
{ 0.000000e+000, 1.000000e+000, 0.000000e+000, 0.000000e+000, 0.000000e+000 },
{ 0.000000e+000, 8.519424e-001, 1.480576e-001, 0.000000e+000, 0.000000e+000 },
{ 0.000000e+000, 0.000000e+000, 7.039050e-001, 2.960950e-001, 0.000000e+000 },
{ 0.000000e+000, 0.000000e+000, 0.000000e+000, 5.744837e-001, 4.255163e-001 },
{ 0.000000e+000, 0.000000e+000, 0.000000e+000, 0.000000e+000, 0.000000e+000 }
},
{
{{// state 1
{ // pdf 1
8.379531e-002,
{ -1.100132e+001, -1.507629e+000, 5.286411e+000, 5.901514e+000, 1.883457e+000, 2.984173e-001, -2.267562e+000, -1.421130e+000, -2.029700e+000, -8.125367e-001, -5.360930e-001, -2.711542e+000, 5.227489e+001, -5.095788e+000, -1.696621e+000, -7.312185e-001, 1.086982e+000, 1.082798e+000, 6.809577e-001, 9.642316e-001, 1.288318e+000, 2.270788e+000, 9.616309e-001, 3.370467e-001, 5.757959e-001, -9.360286e-001, 5.963516e-001, -5.518724e-001, -6.216772e-001, -1.133040e+000, -1.055158e+000, -2.527018e-001, -5.493749e-001, -8.677255e-002, -4.314532e-001, 4.211203e-002, 1.891589e-001, -1.295372e-001, 2.562751e-001 },
{ 2.583579e+001, 1.714888e+001, 1.768794e+001, 1.732637e+001, 1.677207e+001, 2.317034e+001, 1.957299e+001, 1.885118e+001, 1.923330e+001, 1.748584e+001, 1.841182e+001, 1.546110e+001, 2.689937e+001, 2.333710e+000, 2.154598e+000, 5.479347e+000, 5.589773e+000, 4.148128e+000, 3.470205e+000, 3.396770e+000, 3.723966e+000, 4.144585e+000, 3.967475e+000, 3.933262e+000, 2.597734e+000, 1.499691e+000, 5.463322e-001, 4.699343e-001, 6.001114e-001, 6.452432e-001, 5.413819e-001, 6.319258e-001, 6.051217e-001, 6.727058e-001, 7.212463e-001, 7.243521e-001, 6.977258e-001, 5.134848e-001, 2.294584e-001 }
...
我知道结构 hmmType 中有转换矩阵。
1) 但是为什么 [N_STATE+2][N_STATE+2] 不是 [N_STATE][N_STATE]?
2)这是否意味着从一部手机到另一部手机的转换概率?那么我怎样才能用它来知道从'f'到't'的转换概率呢?
3)或者只是在同一部手机中从一个州到另一个州?
4)如果这是正确的,我怎样才能获得从一部手机到另一部手机的转换概率?(例如'f'->'t')据我所知如果我想用维特比算法进行语音识别,我需要转换概率从一部手机到另一部手机,但我什至不确定这些数据是否包含它。我应该从数据中训练它吗?