⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 models.tex

📁 隐马尔科夫模型工具箱
💻 TEX
📖 第 1 页 / 共 5 页
字号:
\>\>\>    \hmkw{Mean} 4 \\\>\>\>\>       0.1 0.0 0.0 0.8  \\\>\>\>    \hmkw{Variance} 4 \\\>\>\>\>       1.0 1.0 1.0 1.0  \\\>\hmkw{State} 3 \hmkw{NumMixes} 2  \\\>\>    \hmkw{Mixture} 1 0.7 \\\>\>\>    \hmkw{Mean} 4 \\\>\>\>\>       0.1 0.2 0.6 1.4 \\ \>\>\>    \hmkw{Variance} 4 \\\>\>\>\>       1.0 1.0 1.0 1.0 \\ \>\>    \hmkw{Mixture} 2 0.3 \\\>\>\>    \hmkw{Mean} 4 \\\>\>\>\>       2.1 0.0 1.0 1.8  \\\>\>\>    \hmkw{Variance} 4 \\\>\>\>\>       1.0 1.0 1.0 1.0 \\ \> \hmkw{TransP} 4 \\\>\>   0.0 1.0 0.0 0.0 \\\>\>   0.0 0.5 0.5 0.0 \\\>\>   0.0 0.0 0.6 0.4 \\\>\>   0.0 0.0 0.0 0.0 \\\hmkw{EndHMM} }{}Notice that only the secondstate has a full covariance Gaussian component.  The first statehas a mixture of two diagonal variance Gaussian components.  Again, thisillustrates the flexibility of HMM definition in \HTK.  If requiredthe structure of everyGaussian can be individually configured.Another possible way to store covariance information is in the formof the Choleski decomposition\index{Choleski decomposition} $L$ of the inverse covariance matrixi.e. $\bm{\Sigma}^{-1} = LL'$.Again this is stored externally in upper triangular form so $L'$ isactually stored.  It is distinguished from the normal inverse covariancematrix by using the keyword \hmkw{LLTCovar}\index{lltcovar@$<$LLTCovar$>$} in place of \hmkw{InvCovar}\footnote{The Choleski storage format is not used by default in \HTK\ Version 2}.  The definition for \textsf{hmm3} also illustrates anothermacro type, that is, \hmmt{o}.  This macro is used as an alternativeway of specifying global options and, in fact, it is the format usedby \HTK\ tools when they write out a HMM definition.  It is provided so that globaloptions can be specifed ahead of any other HMM parameters.  As willbe seen later, this is useful when using many types of macro.\index{HMM definition!global options macro}As noted earlier, the observation vectors used to representthe speech signal can be divided into two or more statisticallyindependent data streams.  This corresponds to the splitting-upof the input speech vectors as described in section~\ref{s:streams}.In HMM definitions, the use of multiple datastreams must be indicated by specifying the number of streams andthe width (i.e\ dimension) of each stream as a globaloption.  This is done using the keyword \hmkw{StreamInfo}\index{streaminfo@$<$StreamInfo$>$} followedby the number of streams, and then a sequence of numbers indicatingthe width of each stream.  The sum of thesestream widths must equal the original vector size as indicatedby the  \hmkw{VecSize} keyword. An example of a HMM definition for multiple data streams\index{HMM definition!multiple data streams}is \textsf{hmm4} shown in Fig~\href{f:hmm4def}.  This HMM is intended to model 2 distinctstreams, the first has 3 components and the second has 1.This is indicated by the global option \hmkw{StreamInfo} 2 3 1.The definition of each state output distribution nowincludes means and variances for each individual stream.Thus, in Fig~\href{f:hmm4def}, each state is subdivided into2 streams using the \hmkw{Stream}\index{stream@$<$Stream$>$} keyword followed by the streamnumber.  Note also, that each individual stream can be weighted.In state 2 of \textsf{hmm4}, the vector following the\hmkw{SWeights}\index{sweights@$<$SWeights$>$} keyword indicates thatstream 1 has a weight of 0.9 whereasstream 2 has a weight of 1.1.  There is no stream weight\index{HMM definition! stream weight} vectorin state 3 and hence the default weight of 1.0 will beassigned to each stream.\vspace{1.0cm}\putprog{hmm3def}{100}{HMM with Full Covariance}{\hmmt{o}  \hmkw{VecSize} 4 \hmkw{MFCC} \\\hmmc{h}{hmm3} \\\hmkw{BeginHMM}  \\\> \hmkw{NumStates} 4  \\\> \hmkw{State} 2 \hmkw{NumMixes} 2 \\\>\>   \hmkw{Mixture} 1 0.4 \\\>\>\>    \hmkw{Mean} 4 \\\>\>\> \>      0.3 0.2 0.2 1.0 \\ \>\>\>    \hmkw{Variance} 4 \\\>\>\> \>      1.0 1.0 1.0 1.0 \\ \>\>\>   \hmkw{Mixture} 2 0.6 \\\>\>\>    \hmkw{Mean} 4 \\\>\>\>\>       0.1 0.0 0.0 0.8  \\\>\>\>    \hmkw{Variance} 4 \\\>\> \>\>      1.0 1.0 1.0 1.0 \\ \> \hmkw{State} 3 \hmkw{NumMixes} 1 \\\>\>   \hmkw{Mean} 4 \\\>\>\>       0.1 \> 0.2 \> 0.6 \> 1.4 \\ \>\>    \hmkw{InvCovar} 4 \\\>\>\>       1.0 \> 0.1 \> 0.0 \> 0.0\\\>\>\>       \>  1.0 \>  0.2 \> 0.0\\\>\>\>       \>\>  1.0 \>  0.1\\\>\>\>       \>\>\> 1.0 \\\> \hmkw{TransP} 4 \\\>\>   0.0 1.0 0.0 0.0 \\\>\>   0.0 0.5 0.5 0.0 \\\>\>   0.0 0.0 0.6 0.4 \\\>\>   0.0 0.0 0.0 0.0 \\\hmkw{EndHMM}}No \HTK\ tools are supplied for estimating optimal stream weight\index{HMM definition!stream weight} values.  Hence, they must either be set manually or derivedfrom some outside source.  However, once set, they are used inthe calculation of output probabilities as specified in equations~\ref{e:cdpdf} and \ref{e:ddpdf}, and hence they willaffect the operation of both the training and recognition tools.\putprog{hmm4def}{100}{HMM with 2 Data Streams}{\hmmt{o} \>  \hmkw{VecSize} 4 \hmkw{MFCC} \\\> \hmkw{StreamInfo} 2 3 1 \\\hmmc{h}{hmm4} \\\hmkw{BeginHMM}  \\\> \hmkw{NumStates} 4 \\\> \hmkw{State} 2 \\\>\>   \hmkw{SWeights} 2 0.9 1.1 \\\>\>   \hmkw{Stream} 1 \\\>\>\>     \hmkw{Mean} 3 \\\>\>\>\>      0.2 0.1 0.1 \\\>\>\>     \hmkw{Variance} 3 \\\>\>\>\>       1.0 1.0 1.0 \\\>\>   \hmkw{Stream} 2 \\\>\>\>     \hmkw{Mean} 1 0.0 \\\>\>\>     \hmkw{Variance} 1 4.0 \\\> \hmkw{State} 3 \\\>\>   \hmkw{Stream} 1 \\\>\>\>     \hmkw{Mean} 3 \\\>\>\>\>       0.3 0.2 0.0 \\\>\>\>     \hmkw{Variance} 3 \\\>\>\>\>       1.0 1.0 1.0 \\\>\>   \hmkw{Stream} 2 \\\>\>\>     \hmkw{Mean} 1 0.5 \\\>\>\>     \hmkw{Variance} 1 3.0 \\\> \hmkw{TransP} 4 \\\>\>   0.0 1.0 0.0 0.0 \\\>\>   0.0 0.6 0.4 0.0 \\\>\>   0.0 0.0 0.4 0.6 \\\>\>   0.0 0.0 0.0 0.0 \\\hmkw{EndHMM}}\mysect{Macro Definitions}{HMMmac}So far, basic model definitions have been described in whichall of the information required to define a HMM has beengiven directly between the  \hmkw{BeginHMM} and \hmkw{EndHMM}keywords.  As an alternative, \HTK\ allows the internalparts of a definition to be written as separate units, possiblyin several different files, and then referenced by name wherever theyare needed.  Such definitions are called \textit{macros}.  \sideprog{mac5def}{50}{Simple Macro Definitions}{\hmmt{o} \hmkw{VecSize} 4 \hmkw{MFCC} \\\\\hmmc{v}{var} \\\> \hmkw{Variance} 4 \\\>\>    1.0 1.0 1.0 1.0  \\}{}HMM (\hmmt{h}) and global option macros\index{macros}\index{HMM definition!macros} (\hmmt{o})have already been described.  In fact, these are both ratherspecial cases since neither is ever referenced explicitly byanother definition.  Indeed, the option macro is unusual in thatsince it is global and must be unique, it has no name.As an illustration of the use of macros, it may be observedthat the variance vectors in the HMM definition \textsf{hmm2} givenin Fig~\href{f:hmm2def} are all identical.  If this wasintentional, then the variance vector could be defined as a macroas illustrated in Fig~\href{f:mac5def}.  A macro definition\index{macro definition} consists of a macro type indicatorfollowed by a user-defined macro name.  In this case, the indicator is \hmmt{v}and the name is \textsf{var}. Notice that a global options macro is includedbefore the definition for \textsf{var}. \HTK\ must know these before it canprocess any other definitions thus the first macro file specified on thecommand line of any \HTK\ tool must have the global options macro.  Globaloptions macro need not be repeated at the head of every definition file, but itdoes no harm to do so.\sideprog{hmm5def}{60}{A Definition Using Macros}{\hmmc{h}{hmm5} \\\hmkw{BeginHMM} \\\> \hmkw{NumStates} 4  \\\> \hmkw{State} 2 \hmkw{NumMixes} 2 \\\>\>   \hmkw{Mixture} 1 0.4 \\\>\>\>    \hmkw{Mean} 4 \\\>\>\>\>       0.3 0.2 0.2 1.0  \\\>\>\>    \hmmc{v}{var} \\\>\>   \hmkw{Mixture} 2 0.6 \\\>\>\>    \hmkw{Mean} 4 \\\>\>\>\>      0.1 0.0 0.0 0.8  \\\>\>\>    \hmmc{v}{var} \\\> \hmkw{State} 3 \hmkw{NumMixes} 2 \\\>\>   \hmkw{Mixture} 1 0.7 \\\>\>\>    \hmkw{Mean} 4 \\\>\>\>\>       0.1 0.2 0.6 1.4  \\\>\>\>    \hmmc{v}{var} \\\>\>   \hmkw{Mixture} 2 0.3 \\\>\>\>    \hmkw{Mean} 4 \\\>\>\>\>       2.1 0.0 1.0 1.8  \\\>\>\>    \hmmc{v}{var} \\\> \hmkw{TransP} 4 \\\>\>   0.0 1.0 0.0 0.0 \\\>\>   0.0 0.5 0.5 0.0 \\\>\>  0.0 0.0 0.6 0.4 \\\>\>   0.0 0.0 0.0 0.0 \\\hmkw{EndHMM} }{}Once defined,  a macro is used simply by writing the typeindicator and name exactly as written in the definition.Thus, for example, Fig~\href{f:hmm5def} defines a HMM called\textsf{hmm5} which uses the variance macro  \textsf{var} butis otherwise identical to the earlier HMM definition \textsf{hmm2}.\index{macro substitution}The definition for \textsf{hmm5} can be understood by substitutingthe textual body of the \textsf{var} macro everywhere that it isreferenced.  Textually this would make the definition for \textsf{hmm5}identical to that for \textsf{hmm2}, and indeed, if input to a recogniser,their effects would be similar.  However, as will become clear in later chapters,the HMM definitions \textsf{hmm2} and  \textsf{hmm5} differin two ways.  Firstly,  ifany attempt was made to re-estimate the parameters of \textsf{hmm2},the values of the variance vectors would almost certainlydiverge.  However,the variance vectors of \textsf{hmm5} are tied together and areguaranteed to remain identical, even after re-estimation.  Thus,in general, the use of a macro enforces a \textit{tying} whichresults in the corresponding parameters being shared amongstall the HMM structures which reference that macro.Secondly, when used in a recognition tool, the computation requiredto decode using HMMs with tied parameters will often be reduced.This is particularly true when higher level parts of a HMM definitionare tied such as whole states.There are many different macro types\index{HMM definition!macro types}\index{macros!types}.  Some have specialmeanings but the following correspond tothe various distinct points in the hierarchy of HMM parameters whichcan be tied.  \begin{tabbing}+ \= ++++ \=  \kill\> \hmmt{s} \>  shared state distribution\\\> \hmmt{m} \>  shared Gaussian mixture component \\\> \hmmt{u} \>  shared mean vector \\\> \hmmt{v} \>  shared diagonal variance vector \\\> \hmmt{i} \>  shared inverse full covariance matrix \\\> \hmmt{c} \>  shared choleski $L'$ matrix \\\> \hmmt{x} \>  shared arbitrary transform matrix\footnote{Transform matrices are not used by any of the supported HTK tools.} \\\> \hmmt{t} \>  shared transition matrix \\\> \hmmt{d} \>  shared duration parameters \\\> \hmmt{w} \>  shared stream weight vector \end{tabbing}Fig~\href{f:hierarch} illustrates these potentialtie points\index{parameter tie points} graphically for the case of continuous density HMMs.In this figure, each solid black circle represents a potentialtie point, and the associated macro type is indicated alongside it.\centrefig{hierarch}{120}{HMM Hierarchy and Potential Tie Points}\noindentThe tie points for discrete HMMs are identical except that themacro types \hmmt{m}, \hmmt{v}, \hmmt{c}, \hmmt{i} and \hmmt{u} are notrelevant and are therefore excluded.The macros with special meanings\index{macros!special meanings} are as follows\begin{tabbing}+ \= ++++ \= ++++++++++++++ \= ++++ \=\kill\> \hmmt{l} \>  logical HMM \> \hmmt{h} \>  physical HMM \\\> \hmmt{o} \>  global option values \> \hmmt{p} \>  tied mixture \\\> \hmmt{r} \>  regression class tree \> \hmmt{j} \> linear transform\end{tabbing}The distinction between logical and physical HMMs will be explainedin the next section and option macros have already been described.The \hmmt{p} macro is used by the HMM editor \htool{HHEd}for building tied mixture systems (see section~\ref{s:tmix}).The \hmmt{l} or \hmmt{p} macros are special in the sensethat they are created implicitly in order to represent specific kinds of parameter sharing and they never occur explicitly in HMM definitions.\mysect{HMM Sets}{hmmsets}The previous sections have described how a single HMM definitioncan be specified.  However, many \HTK\ tools require complete modelsets to be specified rather than just a single model.\index{HMM sets}When this is the case, the individual HMMs which belong to the setare listed in a file rather than being enumerated explicitly onthe command line.  Thus, for example, a typical invocation ofthe tool \htool{HERest} might be as follows\begin{verbatim}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -