翻译的SphinxTrain说明文件

来源:互联网 发布:幼儿编程游戏 编辑:程序博客网 时间:2024/05/17 08:05

* 训练前准备

** 考虑占用的内存空间:

- 半连续模型至少需要的内存(多台机器每台都需要) 模型数*状态数*特征维数*混合数*sizeof(float),最好再*2。
- 连续模型因为只需要存每个混合的均值和方差,可以训练接近12倍于semi-continuous的模型

** 数据准备

*** 需要准备一下一些文件:

文件用途 || 现在的文件名 || 附注
特征文件 |  -          | 需要用Sphinx III 提供的一些工具提取(MFCC...)
控制文件(特征列表) | .fileids | 特征文件的完整路径,每行一个文件,不需要扩展名。(注意不要有空格,不要有0x0D,0x0A)
脚本文件 | .transcription | 词脚本与fileids中每一条记录对应(以<verbatim><s></verbatim>开头<verbatim></s></verbatim>结尾)
主词典 | .dic | 词到音子的映射
filler 词典 | .filler | Garbage模型
音子列表 | .phone ||| 列出所有的音子

主词典例子 :: 主词典可以是多发音的,对每个词加上编号:

<example>
DIRECTING D AY R EH K T I ng
DIRECTING(2) D ER EH K T I ng
...
</example>

这些文件需要保证一致性,参见[[TranscriptionVerification][验证脚本一致性]]

*** 特征层次的问题

特征的表示规则是这样的:

- 每个Stream用逗号分开
- 每个维度用字母表示其意义 c 表示倒谱, d 表示一阶差分, dd 表示二阶差分
- 具体作用于某个维度,则在字母后面加上/数字 /来表示,0是第一维,L-1是最后一维

<example>
c/1..L-1/,d/1..L-1/,c/0/d/0/dd/0/,dd/1..L-1/
</example>

* 训练连续模型

** 建立模型定义文件(上下文无关)

命令 ::  mk_model_def

参数 ::
列表如下

参数  || 描述
-phonelstfn | phonelist 文件的文件名
-modedeffn | 要生成的文件名
-n_state_pm | 每个hmm中包含的状态数

输出 :: 输出将被放到stdout上,需要重定向

例子:: 来自Sphinx III Document

<example>
# Generated by /mk_model_def on Thu Aug 10 14:57:15 2000
0.3
3 n_base
0 n_tri
12 n_state_map
9 n_tied_state
9 n_tied_ci_state
3 n_tied_tmat
#
# Columns definitions
#base lft  rt p attrib   tmat  ...state id's ...
SIL    -   -  - filler    0    0       1      2     N
A      -   -  -    n/a    1    3       4      5     N
B      -   -  -    n/a    2    6       7      8     N

The # lines are simply comments. The rest of the variables mean the following:

  n_base      : no. of phones (also called "base" phones) that you have
  n_tri       : no. of triphones (we will explain this later)
  n_state_map : Total no. of HMM states (emitting and non-emitting)
                The Sphinx appends an extra terminal non-emitting state
                to every HMM, hence for 3 phones, each specified by
                the user to be modeled by a 3-state HMM, this number
                will be 3phones*4states = 12
  n_tied_state: no. of states of all phones after state-sharing is done.
                We do not share states at this stage. Hence this number is the
                same as the total number of emitting states, 3*3=9
n_tied_ci_state:no. of states for your "base" phones after state-sharing
                is done. At this stage, the number of "base" phones is
                the same as the number of "all" phones  that you are modeling.
                This number is thus again the total number of emitting
                states, 3*3=9
 n_tied_tmat   :The HMM for each CI phone has a transition probability matrix
                 associated it. This is the total number of transition
                 matrices for the given set of models. In this case, this
                 number is 3.

Columns definitions: The following columns are defined:
       base  : name of each phone
       lft   : left-context of the phone (- if none)
       rt    : right-context of the phone (- if none)
       p     : position of a triphone (not required at this stage)
       attrib: attribute of phone. In the phone list, if the phone is "SIL",
        or if the phone is enclosed by "+", as in "+BANG+", the sphinx
        understands these phones to be non-speech events. These are
        also called "filler" phones, and the attribute "filler" is
        assigned to each such phone. The base phones have no special
        attributes, and hence are labelled as "n/a", standing for
        "no attribute"  
      tmat   : the id of the transition matrix associated with the phone
 state id's  : the ids of the HMM states associated with any phone. This list
               is terminated by an "N" which stands for a non-emitting
               state. No id is assigned to it. However, it exists, and is

</example>


** 建立模型拓扑结构

非常简单,就是一个矩阵,允许跳转的节点为非0,反之为0。

<example>
4
1.0     1.0     0.0     0.0
0.0     1.0     1.0     0.0
0.0     0.0     1.0     1.0
</example>

不过需要注意,Sphinx会添加一个无输出的结束状态。所以上面只有三行

** CI模型初始化 (Flat Initialization)

CI 模型由4部分组成:

- mixture_weights: 分量权重
- transition_matrices: 状态调转概率
- means: 所有高斯的均值
- variances: 所有高斯的方差

初始化mixtrue_weights和transition_matrices用到了 **mk_flat** 命令。参数表如下

参数 || 用途
-moddeffn | 模型描述文件,上一步生成
-topo | 模型拓扑结构
-mixwfn | 需要输出的mixture_weight文件名
-tmatfn | 需要输出的transition_matrices文件名
-nstream | 独立的特征stream,训练连续模型时必须为1
-ndensity ||| 每个模型的高斯数,CI模型必须是1

初始化均值方差用的是将所有特征矢量的均值方差赋给每个模型的对应值。因为这个操作数量非常的大,所以需要并行处理。分布在多台机器上共同运算,之后将结果写回到某一个accumulate dir中。命令为 *init_gau* 。

参数 || 用途
-accumdir | 中间目录(我们可以用NFS映射,直接将其写回主机)
-ctlfn | control file,就是fileids文件
-part | 算第几部分
-npart | 总共几部分
-cepdir | 放特征的路径
-cepext | 特征扩展名。 最后特征文件名是这样生成的: **cepdir + (a line in ctlfn) + cepext**
-feat | 特征类型
-ceplen | 存储在文件中的特征维数(不是feat中的特征维数,因为一阶二阶差分是算出来的。
-arc | 自动增益控制(??)
-cmn | 倒谱均值归一化
-varnorm ||| 方差归一化(上面两个都是yes/no)选择

第一次做完后,要对buffer中的数据做归一化。用到命令 **norm** 。

参数 || 用途
-accumdir | 不说了
-meanfn | 输出的全局均值文件
-feat | 特征类型
-ceplen | 和上面的一样,特征维数

再接下来就是汇集过程(accumulate),还是调用 **init_gau** 命令。这一次是为了计算全局方差,参数略有不同。

参数 || 用途
-accumdir | 中间目录(我们可以用NFS映射,直接将其写回主机)
**-meanfn** | **全局均值文件**
-ctlfn | control file,就是fileids文件
-part | 算第几部分
-npart | 总共几部分
-cepdir | 放特征的路径
-cepext | 特征扩展名。 最后特征文件名是这样生成的: **cepdir + (a line in ctlfn) + cepext**
-feat | 特征类型
-ceplen | 存储在文件中的特征维数(不是feat中的特征维数,因为一阶二阶差分是算出来的。
-arc | 自动增益控制(??)
-cmn | 倒谱均值归一化
-varnorm ||| 方差归一化(上面两个都是yes/no)选择

接下来还要在运行一次 **norm** 命令,参数也略有不同

参数 || 用途
-accumdir | 不说了
**-varfn** | 输出的全局方差文件
-feat | 特征类型
-ceplen | 和上面的一样,特征维数

这样我们就获得了均值方差两个文件,下面需要把他们拷贝到每个状态中去。需要用命令 **cp_parm** 。之前需要建立一个 *copyoperation map* 文件。这个文件也就是将某一个状态映射到另外一个状态。分为两列,都是数字:
<example>
0 0
1 0
2 0
3 0
....
</example>
第一列数字表示拷贝的目标,0表示第一个phone的第一个状态,1表示第二个状态....直到第n个phone的第k个状态,不断递增。第二个参数则是拷贝的来源。

**cp_parm** 的参数表:

参数 || 用途
-cpopsfn | *copyoperation map* 文件名
-igaufn | 输入的均值文件(或者方差文件)
-ncbout | 状态总数(n*k)
-ogaufn | 输出的均值(方差)文件。

需要运行两次,一次拷贝均值,一次拷贝方差。

** 训练CI模型

Baum-Welch算法将给出一个收敛率。CMU建议的停止迭代的收敛率为 **0.1-0.001** 好像等于没说。

算法用到的程序为 **bw** 。也是可以并行计算,并且写回结果的。参数列表如下:

参数 || 用途
-moddeffn | 模型定义文件
-ts2cbfn | 训练的模型是连续时,设置为 *.cont.* ,半连续时,设置为 *.semi.* 
-mixwfn  | 初始化的时候得到的mixture_weight文件
-mwfloor | mixture_weight的最小值,如果小于这个值,都设置为这个值。
-tmatfn  | 转移概率矩阵文件名
-meanfn | 均值文件名
-varfn | 方差文件名
-dictfn | 词典文件名 
-fdictfn | Filler词典文件名
-ctlfn | 控制文件文件名(.fileids) 
-part | 如果分成多块训练,这里应该是训练的部分的标号。从1开始,如果分三份,则为1,2,3
-npart | 共有几份?
-cepdir | 特征文件保存的路径
-cepext | 特征的扩展名 
-lsnfn | 脚本文件名(.transcription) 
-accumdir | accumulate 路径
-varfloor | 方差的最小值 
-topn  | 最多考虑几个高斯。就是说,如果现在是8高斯,其实很多高斯概率很低,只考虑4各就可以了。这样就只算前四个. 
-abeam | 前向beam宽度
-bbeam | 后向beam宽度
-agc | 那个什么自动增益控制
-cmn | 均值归一化
-varnorm | 方差归一化
-meanreest | 均值重新估计
-varreest | 方差重新估计
-2passvar | 好像是说用当前的还是前一步的均值来估计方差。原文照抄如下: Setting this flag to "yes" lets bw use the previous means in the estimation of the variance. The current variance is then estimated as E[(x - prev_mean)2]. If this flag is set to "no" the current estimate of the means are used to estimate variances. This requires the estimation of variance as E[x2] - (E[x])2, an unstable estimator that sometimes results in negative estimates of the variance due to arithmetic imprecision
-tmatreest | 是否重估转移概率阵
-feat | 特征类型
-ceplen | 特征长度

即使只是在一台机器上运行,还是需要对结果进行归一化。这一步在每次迭代都要运行,还是使用 **norm** 。

参数 || 用途
-accumdir | 中间结果保存的目录
-feat | 特征类型
-ceplen | 和上面的一样,特征维数
-mixfn | mixture_weight文件名
-tmatfn | 转移概率阵文件名
-meanfn | 均值文件名
-varfn | 方差文件名

***如果没有重估其中某一个文件,那么不要写这个参数!否则会出错***

----

经过上面的步骤,上下文无关的模型就建立好了。下面要建立非绑定的上下文相关模型(Context Dependent,CD)

** 建立CD模型定义文件

下面要建立Context Dependent 的模型定义文件,以三音子为例。第一步,把所有的音子列成下面的形式:

<example>
phone1 0 0 0 0
phone2 0 0 0 0
phone3 0 0 0 0
phone4 0 0 0 0
...
</example>

这个列表的顺序必须和CI训练中用到的phonelist的顺序一致。然后需要建立一个临时的词典,包括除了filler以外所有的词, *SIL* 也必须包含在内。

再接下来,用程序 **quick_count** 建立所有的三音子列表。参数如下:

参数 || 用途
-q  | 让程序考虑所有的词对
-p | 前面的phonelist文件
-b | 临时dict文件
-o | 输出的triphonelist

典型的输出:

<example>
AA(AA,AA)s              1
AA(AA,AE)b              1
AA(AA,AO)1              1
AA(AA,AW)e              1
</example>

需要用程序对脚本做一些处理,1需要被改成i。最后的输出应该是这样的:

<example>
AA AA AA s
AA AA AE b
AA AA AO i
AA AA AW e
</example>

最后,还需要把CI的phone添加到文件最前面。结果应该如此:

<example>
AA - - -
AE - - -
AO - - -
AW - - -
..
..                                                        
AA AA AA s
AA AA AE b
AA AA AO i
AA AA AW e
</example>

根据已经获得的triphonelist,可以建立模型定义文件了。用的还是 **mk_model_def** 。

参数  || 描述
**-phonelstfn** | triphonelist文件名
-modedeffn | 要生成的文件名
-n_state_pm | 每个hmm中包含的状态数

为了后面的"shortlist"需要,我们还要统计每个三音子在脚本中出现的次数。这一过程由 **param_cnt** 完成。

参数 || 描述
-modedeffun | 模型定义文件,包含所有可能的triphone
-ts2cbfn | *.cont.*
-ctlfn | .fileids文件
-lsnfn | 脚本,transcription
-dictfn | 词典文件
-fdictfn | fill词典
-paramtype | *phone*
-segdir | */dev/null*

这个命令也直接在stdout上输出,所以应该重定向.

<example>
(param_cnt [arguments] > triphone_count_file) >&! LOG
</example>

输出结果类似:

<example>
+GARBAGE+ - - - 98
+LAUGH+ - - - 29
SIL - - - 31694
AA - - - 0
AE - - - 0
...
AA AA AA s 1
AA AA AE s 0
AA AA AO s 4
</example>

根据这个输出,可以把出现次数太少的triphone去掉。输出为shortlist,之后再用一次 **mk_model_def** ,根据裁减后的list得到新的模型定义文件。下面再列出得到模型定义文件的例子(包括说明)

<example>
# Generated by /mk_model_def on Thu Aug 10 14:57:15 2000
0.3
5 n_base
7 n_tri
48 n_state_map
36 n_tied_state
15 n_tied_ci_state
5 n_tied_tmat                                                                 
#
# Columns definitions
#base lft  rt p attrib   tmat  ...state id's ...
SIL     -   -  - filler    0    0       1      2     N
AE      -   -  -    n/a    1    3       4      5     N
AX      -   -  -    n/a    2    6       7      8     N
B       -   -  -    n/a    3    9       10     11    N
T       -   -  -    n/a    4    12      13     14    N
AE      B   T  i    n/a    1    15      16     17    N
AE      T   B  i    n/a    1    18      19     20    N
AX      T   T  s    n/a    2    21      22     23    N
B       SIL AE b    n/a    3    24      25     26    N
B       AE  SIL e   n/a    3    27      28     29    N
T       AE  AX e    n/a    4    30      31     32    N
T       AX  AE b    n/a    4    33      34     35    N

The # lines are simply comments. The rest of the variables mean the following:

  n_base      : no. of CI phones (also called "base" phones), 5 here
  n_tri       : no. of triphones , 7 in this case
  n_state_map : Total no. of HMM states (emitting and non-emitting)
                The Sphinx appends an extra terminal non-emitting state
                to every HMM, hence for 5+7 phones, each specified by
                the user to be modeled by a 3-state HMM, this number
                will be 12phones*4states = 48
  n_tied_state: no. of states of all phones after state-sharing is done.
                We do not share states at this stage. Hence this number is the
                same as the total number of emitting states, 12*3=36
n_tied_ci_state:no. of states for your CI phones after state-sharing    
                is done. The CI states are not shared, now or later.
                This number is thus again the total number of emitting CI
                states, 5*3=15
 n_tied_tmat   : The total number of transition matrices is always the same
                 as the total number of CI phones being modeled. All triphones
                 for a given phone share the same transition matrix. This
                 number is thus 5.

Columns definitions: The following columns are defined:
       base  : name of each phone
       lft   : left-context of the phone (- if none)
       rt    : right-context of the phone (- if none)
       p     : position of a triphone. Four position markers are supported:
               b = word begining triphone
               e = word ending triphone
               i = word internal triphone
               s = single word triphone
       attrib: attribute of phone. In the phone list, if the phone is "SIL",
               or if the phone is enclosed by "+", as in "+BANG+", these
              phones are interpreted as non-speech events. These are
               also called "filler" phones, and the attribute "filler" is
               assigned to each such phone. The base phones and the
               triphones have no special attributes, and hence are
               labelled as "n/a", standing for "no attribute"
      tmat   : the id of the transition matrix associated with the phone     
 state id's  : the ids of the HMM states associated with any phone. This list
               is terminated by an "N" which stands for a non-emitting
               state. No id is assigned to it. However, it exists, and is
               listed.
</example>

** 初始化CD模型

把CI模型的参数直接应用到CD模型。用到的程序: **init_mixw** 。

参数 || 用途
-src_moddeffn | CI模型定义文件
-src_ts2cbfn | *.cont.*
-src_mixwfn | CI mixture-weight 文件
-src_meanfn | CI 均值文件 
-src_varfn | CI 方差文件 
-src_tmatfn | CI 转移概率阵 
-dest_moddeffn | CD untied 模型定义文件
-dest_ts2cbfn | *.cont.*
-dest_mixwfn | CD untied mixture-weight文件 
-dest_meanfn | CD 均值文件 
-dest_varfn | CD 方差文件 
-dest_tmatfn | CD 转移概率文件 
-feat | 特征类型 
-ceplen | 特征维数
 


** 训练untied CD模型

训练过程和CI模型基本完全一致,也是用 **bw** 迭代,并且用 **norm** 归一化。参数完全一样。

** 决策树聚类

决策树聚类是为了将多个音子绑定到一起,称为 **senone** 。这个过程分为两部分:

首先要建立一些语言学问题,也就是决策树的判断依据。一般来说用自动的方法建立。也就是通过比较CI模型间的相似性来确定问题集。这一步骤可以通过 **mk_quests** 来建立。

参数 || 用途
-moddeffn | CI模型定义文件
-meanfn | CI 均值文件
-varfn | CI 方差文件
-mixwfn | CI mixture_weight文件
-npermute | 分支度,一般来说在8到12之间。太大的法,可能无法计算。
-niter | 迭代次数,一般来说设置为1或者2,超过二就饱和了。
-qstperstt | The algoritm clusters state distributions belonging to each state of the CI phone HMMs to generate questions. Thus all 1st states are clustered to generate one subset of questions, all 2nd states are clustered for the second subset, and so on. qstperstt determines how many questions are to be generated by clustering any state. Typically this is set to a number between 20 and 25.
-tempfn | ?? 没说
-questfn | 输出的问题集

在建立好了语言学问题集后,下一步的工作就是建立决策树。建立决策树的方法是程序 **bldtree** 。

参数 || 用途
-treefn | 输出的决策树名称
-moddeffn | **CD** 模型的模型定义文件
-mixwfn | **CD** 模型的mixture_weights文件
-ts2cbfn | *.cont.*
-meanfn | **CD** 模型的均值文件
-varfn | **CD** 模型的方差文件
-mwfloor | mixture_weight 的最小值
-psetfn | 语言学问题集
-phone | **CI** 的phonelist
-state | 需要建立决策树的状态。如果是3状态HMM,则这个值可以是0,1,2。
-stwt | This flag needs a string of numbers equal to the number of HMM-states, for example, if you were using 5-state HMMs, then the flag could be given as "-stwt 1.0 0.3 0.1 0.01 0.001". Each of these numbers specify the weights to be given to state distributions during tree building, beginning with the *current* state. The second number specifies the weight to be given to the states *immediately adjacent* to the current state (if there are any), the third number specifies the weight to be given to adjacent states *one removed* from the immediately adjacent one (if there are any), and so on. A typical set of values for 5 state HMMs is "1.0 0.3 0.1 0.01 0.001"
-ssplitmin | simple tree中的最小分支度,一般来说为1
-splitemax | simple tree中的最大的分支度
-ssplitthr | 每个分支带来的最小似然度增加。一般来说为0或一个小正数。
-csplitmin | 决策树中最小分支数
-csplitmax | 决策树中最大分支数
-csplitthr | ...
-cntthresh | ...

** 裁剪决策树

这一步,决定要留下多少个senone来进行训练。完成这个任务的程序为 **prunetree** 。

参数 || 用途
-itreedir | 存储决策树的目录(输入)
-nseno | 需要训练的senone数
-otreedir | 输出裁剪后决策树的目录
-moddef | **CD** 模型的模型定义文件
-psetfn | 语言学问题文件
-minocc | 每个senone最小的出现次数,如果小于这个值,将被去掉。不能为0,否则可能没有被训练到

** 建立CD-tied 模型定义文件

在树被裁剪完成之后,需要再建立一个模型定义文件。需要:

- 包含所有脚本中出现的三音子
- 包含决策树裁减后生成的所有senone

完成这个操作的文件为: **tiestate**

参数 || 用途
-imoddeffn | 包含所有triphone的模型定义文件
-omoddeffn | 输出的模型定义文件
-treedir | 裁剪后的树存储的目录
-psetfn | 语言学问题文件

由包含所有triphone的模型定义文件:

<example>
# Generated by [path]/mk_model_def on Sun Nov 26 12:42:05 2000
# triphone: (null)
# seno map: (null)
#
0.3
5 n_base
34 n_tri
156 n_state_map
117 n_tied_state
15 n_tied_ci_state
5 n_tied_tmat
#
# Columns definitions
#base lft  rt p attrib tmat      ... state id's ...
  SIL   -   - - filler    0    0    1    2    N
   AE   -   - -    n/a    1    3    4    5    N
   AX   -   - -    n/a    2    6    7    8    N
    B   -   - -    n/a    3    9   10   11    N
    T   -   - -    n/a    4   12   13   14    N
   AE   B   T i    n/a    1   15   16   17    N
   AE   T   B i    n/a    1   18   19   20    N
   AX  AX  AX s    n/a    2   21   22   23    N
   AX  AX   B s    n/a    2   24   25   26    N
   AX  AX SIL s    n/a    2   27   28   29    N
   AX  AX   T s    n/a    2   30   31   32    N
   AX   B  AX s    n/a    2   33   34   35    N
   AX   B   B s    n/a    2   36   37   38    N
   AX   B SIL s    n/a    2   39   40   41    N
   AX   B   T s    n/a    2   42   43   44    N
   AX SIL  AX s    n/a    2   45   46   47    N
   AX SIL   B s    n/a    2   48   49   50    N
   AX SIL SIL s    n/a    2   51   52   53    N
   AX SIL   T s    n/a    2   54   55   56    N
   AX   T  AX s    n/a    2   57   58   59    N
   AX   T   B s    n/a    2   60   61   62    N
   AX   T SIL s    n/a    2   63   64   65    N
   AX   T   T s    n/a    2   66   67   68    N
    B  AE  AX e    n/a    3   69   70   71    N
    B  AE   B e    n/a    3   72   73   74    N
    B  AE SIL e    n/a    3   75   76   77    N
    B  AE   T e    n/a    3   78   79   80    N
    B  AX  AE b    n/a    3   81   82   83    N
    B   B  AE b    n/a    3   84   85   86    N
    B SIL  AE b    n/a    3   87   88   89    N
    B   T  AE b    n/a    3   90   91   92    N
    T  AE  AX e    n/a    4   93   94   95    N
    T  AE   B e    n/a    4   96   97   98    N
    T  AE SIL e    n/a    4   99  100  101    N
    T  AE   T e    n/a    4  102  103  104    N
    T  AX  AE b    n/a    4  105  106  107    N
    T   B  AE b    n/a    4  108  109  110    N
    T SIL  AE b    n/a    4  111  112  113    N
    T   T  AE b    n/a    4  114  115  116    N
</example>

经过聚类后得到一个包含39个senone的模型定义文件:

<example>
# Generated by [path]/mk_model_def on Sun Nov 26 12:42:05 2000
# triphone: (null)
# seno map: (null)
#
0.3
5 n_base
34 n_tri
156 n_state_map
54 n_tied_state
15 n_tied_ci_state
5 n_tied_tmat
#
# Columns definitions
#base lft  rt p attrib tmat      ... state id's ...
  SIL   -   - - filler    0    0    1    2    N
   AE   -   - -    n/a    1    3    4    5    N
   AX   -   - -    n/a    2    6    7    8    N
    B   -   - -    n/a    3    9   10   11    N
    T   -   - -    n/a    4   12   13   14    N
   AE   B   T i    n/a    1   15   16   17    N
   AE   T   B i    n/a    1   18   16   19    N
   AX  AX  AX s    n/a    2   20   21   22    N
   AX  AX   B s    n/a    2   23   21   22    N
   AX  AX SIL s    n/a    2   24   21   22    N
   AX  AX   T s    n/a    2   25   21   22    N
   AX   B  AX s    n/a    2   26   21   27    N
   AX   B   B s    n/a    2   23   21   27    N
   AX   B SIL s    n/a    2   24   21   27    N
   AX   B   T s    n/a    2   25   21   27    N
   AX SIL  AX s    n/a    2   26   21   28    N
   AX SIL   B s    n/a    2   23   21   28    N
   AX SIL SIL s    n/a    2   24   21   28    N
   AX SIL   T s    n/a    2   25   21   28    N
   AX   T  AX s    n/a    2   26   21   29    N
   AX   T   B s    n/a    2   23   21   29    N
   AX   T SIL s    n/a    2   24   21   29    N
   AX   T   T s    n/a    2   25   21   29    N
    B  AE  AX e    n/a    3   30   31   32    N
    B  AE   B e    n/a    3   33   31   32    N
    B  AE SIL e    n/a    3   34   31   32    N
    B  AE   T e    n/a    3   35   31   32    N
    B  AX  AE b    n/a    3   36   37   38    N
    B   B  AE b    n/a    3   36   37   39    N
    B SIL  AE b    n/a    3   36   37   40    N
    B   T  AE b    n/a    3   36   37   41    N
    T  AE  AX e    n/a    4   42   43   44    N
    T  AE   B e    n/a    4   45   43   44    N
    T  AE SIL e    n/a    4   46   43   44    N
    T  AE   T e    n/a    4   47   43   44    N
    T  AX  AE b    n/a    4   48   49   50    N
    T   B  AE b    n/a    4   48   49   51    N
    T SIL  AE b    n/a    4   48   49   52    N
    T   T  AE b    n/a    4   48   49   53    N

</example>

** 初始化,以及训练CD-Tied 模型

训练绑定的上下文相关模型,需要以下几个步骤:

1. 初始化模型
2. 用bw算法迭代
3  高斯分裂

如果需要得到2^N个混合的高斯模型,则需要进行N次上面所列的步骤。

初始化用到的程序为 **init_mixw** 。

参数 || 用途
-src_moddeffn | CI模型定义文件
-src_ts2cbfn | *.cont.*
-src_mixwfn | CI mixture-weight 文件
-src_meanfn | CI 均值文件 
-src_varfn | CI 方差文件 
-src_tmatfn | CI 转移概率阵 
-dest_moddeffn | **CD tied** 模型定义文件
-dest_ts2cbfn | *.cont.*
-dest_mixwfn | **CD tied (1 Gauss)**  mixture-weight文件 
-dest_meanfn | CD 均值文件 
-dest_varfn | CD 方差文件 
-dest_tmatfn | CD 转移概率文件  (都是1 Gauss)
-feat | 特征类型 
-ceplen | 特征维数

bw迭代用到 **bw** ,和前面完全一样。只是需要改变参数的取值。
但是 **norm** 需要改变。参数表如下:

参数 || 用途
-accumdir | 中间结果保存的目录
-feat | 特征类型
-ceplen | 和上面的一样,特征维数
-mixfn | mixture_weight文件名
-tmatfn | 转移概率阵文件名
-meanfn | 均值文件名
-varfn | 方差文件名
**-dcountfn** | **输出的density count文件名,将在分裂的时候用到**


而高斯分裂则需要使用 **inc_comp** ,参数列表如下:

参数 || 用途
-ninc | 需要分裂为几个高斯。不一定是现在已经有了的高斯数的两倍,可以是其他值
-ceplen | 特征长度
-dcountfn | 输入的density count文件
-inmixwfn | 输入的mixture_weights
-outmixwfn | 输出的mixture_weights
-inmeanfn | 输入均值文件
-invarfn | 输入方差文件
-outvarfn | 输出方差文件
-feat | 特征定义

 
原创粉丝点击