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

📄 hhed.tex

📁 隐马尔可夫模型源代码
💻 TEX
📖 第 1 页 / 共 3 页
字号:
%/* ----------------------------------------------------------- */


%/*                                                             */


%/*                          ___                                */


%/*                       |_| | |_/   SPEECH                    */


%/*                       | | | | \   RECOGNITION               */


%/*                       =========   SOFTWARE                  */ 


%/*                                                             */


%/*                                                             */


%/* ----------------------------------------------------------- */


%/*         Copyright: Microsoft Corporation                    */


%/*          1995-2000 Redmond, Washington USA                  */


%/*                    http://www.microsoft.com                */


%/*                                                             */


%/*   Use of this software is governed by a License Agreement   */


%/*    ** See the file License for the Conditions of Use  **    */


%/*    **     This banner notice must not be removed      **    */


%/*                                                             */


%/* ----------------------------------------------------------- */


%


% HTKBook - Steve Young and Julian Odell  20/05/97


%


\newpage


\mysect{HHEd}{HHEd}





\subsection{Function}





\index{hhed@\htool{HHEd}|(}


\htool{HHEd} is a script driven editor for manipulating sets of HMM definitions.


Its basic operation is to load in a set of HMMs, apply a sequence of edit


operations and then output the transformed set. \htool{HHEd} is mainly used for


applying tyings across selected HMM parameters.  It also has facilities for


cloning HMMs, clustering states and editing HMM structures.





Many \htool{HHEd} commands operate on sets of similar items selected from the


set of currently loaded HMMs.  For example, it is possible to define a set of


all final states of all vowel models, or all mean vectors of all mixture


components within the model X, etc.  Sets such as these are defined by item


lists using the syntax rules given below.  In all commands, all of the items in


the set defined by an item list must be of the same type where the possible


types are


\begin{tabbing}


+++++++ \= ++ \=  ++++++++++++++++ \= ++ \= \kill


\>  s \> -- state             \> t \> -- transition matrix \\


\>  p \> -- pdf               \> w \> -- stream weights \\


\>  m \> -- mixture component \> d \> -- duration parameters \\


\>  u \> -- mean vector       \> x \> -- transform matrix \\


\>  v \> -- variance vector   \> i \> -- inverse covariance matrix \\


\>  h \> -- HMM definition


\end{tabbing}


\noindent


Most of the above correspond directly to the tie points shown in


Fig~\href{f:hierarch}.  There is just one exception.  The type ``p''


corresponds to a pdf (ie a sum of Gaussian mixtures).  Pdf's cannot


be tied, however, they can be named in a Tie (\texttt{TI}) command


(see below) in which case, the effect is to join all of the contained


mixture components into one pool of mixtures and then all of the


mixtures in the pool are shared across all pdf's.  This allows


conventional {\it tied-mixture} or {\it semi-continuous} HMM systems


to be constructed.





The syntax rules for item lists are as follows.  An item list


consists of a comma separated list of item sets.


{\sf


\begin{tabbing}


++++++ \= ++++++++ \= ++ \= ++++++++++++ \=  \kill


\>     itemList\>  = \> ``\{'' itemSet \{ ``,'' itemSet \} ``\}'' 


\end{tabbing}}


\noindent


Each {\sf itemSet} consists of the name of one


or more HMMs (or a pattern


representing a set of HMMs) followed by a specification


which represents a set of paths down the parameter hierarchy 


each terminating at one of the required parameter items.


{\sf


\begin{tabbing}


++++++ \= ++++++++ \= ++ \= ++++++++++++ \=  \kill


\>      itemSet \>  = \> hmmName . [``transP'' $|$ ``state'' state ]\\


\>      hmmName \>  = \> ident $|$ identList \\


\>     identList\>  = \> ``('' ident \{ ``,'' ident \} ``)'' \\


\>     ident    \>  = \> $<$ char $|$ metachar $>$ \\


\>     metachar \>  = \> ``?'' $|$ ``$\star$''


\end{tabbing}}


\noindent


A {\sf hmmName} consists of a single {\sf ident} or


a comma separated list of {\sf ident}'s.  The following examples


are all valid {\sf hmmName}'s:


\begin{verbatim}


         aa  three  model001  (aa,iy,ah,uh)  (one,two,three)


\end{verbatim}


In addition, an {\sf ident} can contain the metacharacter


``?'' which matches any single character and the metacharacter


``$\star$'' which matches a string of zero or more characters.


For example, the item list


\begin{verbatim}


         {*-aa+*.transP}


\end{verbatim}


would represent the set of transition matrices of all loaded


triphone variations of \texttt{aa}.





Items within states require the state indices to be specified


{\sf


\begin{tabbing}


++++++ \= ++++++++ \= ++ \= ++++++++++++ \=  \kill


\>      state \>  = \> index [``.'' stateComp ] \\


\>      index \>  = \> ``['' intRange \{ ``,'' intRange \} ``]'' \\


\>    intRange \> = \> integer [ ``-'' integer ]


\end{tabbing}}


For example, the item list


\begin{verbatim}


         {*.state[1,3-5,9]}


\end{verbatim}


represents the set of all states 1, 3 to 5 inclusive and 9 of all


currently loaded HMMs.  Items within states include durational


parameters, stream weights, pdf's and all items within mixtures


{\sf


\begin{tabbing}


++++++ \= ++++++++ \= ++ \= ++++++++++++ \=  \kill


\>   stateComp \>  = \> ``dur'' $|$ ``weights'' $|$ [ `` stream'' index ]


        ``.'' ``mix'' [ mix ]


\end{tabbing}}


For example, 


\begin{verbatim}


         {(aa,ah,ax).state[2].dur}


\end{verbatim}


denotes the set of durational parameter vectors from state 2 of the


HMMs \texttt{aa}, \texttt{ah} and \texttt{ax}.  Similarly, 


\begin{verbatim}


         {*.state[2-4].weights}


\end{verbatim}


denotes the set of stream weights for states 2 to 4 of all currently


loaded HMMs.  The specification of pdf's may optionally include a


list of the relevant streams, if omitted, stream 1 is assumed.


For example,


\begin{verbatim}


         {three.state[3].mix}


\end{verbatim}


and


\begin{verbatim}


         {three.state[3].stream[1].mix}


\end{verbatim}


both denote a list of the single pdf belonging to stream 1 of state 3 


of the HMM \texttt{three}.





Within a pdf, the possible item types are mixture components,


mean vectors, and the various possible forms of covariance


parameters


{\sf


\begin{tabbing}


++++++ \= ++++++++ \= ++ \= ++++++++++++ \=  \kill


\>   mix \>  = \>  index [ ``.'' ( ``mean'' $|$ ``cov'' ) ]


\end{tabbing}}


For example,


\begin{verbatim}


         {*.state[2].mix[1-3]}


\end{verbatim}


denotes the set of mixture components 1 to 3 from state 2 of all


currently loaded HMMs and


\begin{verbatim}


         {(one,two).state[4].stream[3].mix[1].mean}


\end{verbatim}


denotes the set of mean vectors from mixture component 1, stream 3,


state 4 of the HMMs \texttt{one} and \texttt{two}.  When {\sf cov}


is specified, the type of the covariance item referred to is 


determined from the \texttt{CovKind} of the loaded models.  Thus,


for diagonal covariance models, the item list


\begin{verbatim}


         {*.state[2-4].mix[1].cov}


\end{verbatim}


would denote the set of variance vectors for mixture 1, states 2 to 4


of all loaded HMMs.





Note finally, that it is not an error to specify non-existent models,


states, mixtures, etc.  All item list specifications are regarded


as patterns which are matched against the currently loaded set of


models.  All and only those items which match are included in


the set.  However, both a null result and a set of items of mixed


type do result in errors.





All \htool{HHEd} commands consist of a 2 character command name followed


by zero or more arguments.  In the following descriptions, item


lists are shown as \texttt{itemList(c)} where the character c denotes the


type of item expected by that command.  If this type indicator is


missing then the command works for all item types.





The \htool{HHEd} commands are as follows





\subsubsection{\texttt{AT i j prob itemList(t)}}





Add a transition from state \texttt{i} to state \texttt{j} with probability


\texttt{prob} for all transition matrices in \texttt{itemList}.  The remaining


transitions out of state \texttt{i} are rescaled so that $\sum_k a_{ik} = 1 $.


For example,


\begin{verbatim}


         AT 1 3 0.1 {*.transP}


\end{verbatim}


would add a skip transition to all loaded models from state 1 to state 3


with probability 0.1.





\subsubsection*{\tt AU hmmList}





Use a set of decision trees to create a new set of models specified


by the \texttt{hmmList}.  The decision trees may be made as a result


of either the \texttt{TB} or \texttt{LT} command.  





Each model in \texttt{hmmList} is constructed in the following manner.


If a model with the same logical name already exists in the


current  HMM set this is used unchanged, otherwise the model is


synthesised from the decision trees.  If the trees cluster at the 


model level the synthesis results in a logical model sharing the


physical model from the tree that matches the new context.  If


the clustering was performed at the state level a prototype model


(an example of the same phone model occurring in a different context)


is found and a new HMM is constructed  that shares the transition


matrix with the prototype model but consists of tied states selected


using the decision tree.





\subsubsection*{\tt CL hmmList}





Clone a HMM list.  The file \texttt{hmmList} should hold a list of HMMs


all of whose logical names are either the same as, or are context-dependent


versions of the currently loaded set of HMMs.  For each name in \texttt{hmmList},


the corresponding HMM in the loaded set is cloned.  On completion, the


currently loaded set is discarded and replaced by the new set.  For example,


if the file \texttt{mylist} contained


\begin{verbatim}


         A-A+A


         A-A+B


         B-A+A


         B-B+B


         B-B+A


\end{verbatim}


and the currently loaded HMMs were just \texttt{A} and \texttt{B}, then


\texttt{A} would be cloned 3 times to give the models \texttt{A-A+A},


\texttt{A-A+B} and \texttt{B-A+A}, and \texttt{B} would be cloned 2 times


to give \texttt{B-B+B} and \texttt{B-B+A}.  On completion, the original


definitions for \texttt{A} and \texttt{B} would be deleted (they could


be retained by including them in the new \texttt{hmmList}).





\subsubsection*{\tt CO newList}





Compact a set of HMMs.  The effect of this command is to


scan the currently loaded set of HMMs and identify all identical


definitions.  The physical name of the first model in each identical


set is then assigned to all models in that set and all


model definitions are replaced by a pointer to the first


model definition.  On completion,


a new list of HMMs which includes the new model tyings is


written out to file \texttt{newList}.  For example, suppose that


models \texttt{A}, \texttt{B}, \texttt{C} and \texttt{D} were currently


loaded and \texttt{A} and \texttt{B} were identical.  Then the command


\begin{verbatim}


         CO tlist


\end{verbatim}


would tie HMMs \texttt{A} and \texttt{B}, 


set the physical name of \texttt{B} to \texttt{A} and output the


new HMM list


\begin{verbatim}


         A


         B A


         C


         D


\end{verbatim}


to the file \texttt{tlist}.  This command is used mainly after 


performing a sequence of parameter tying commands.





\subsubsection*{\tt DP s n id ...}





Duplicates a set of HMMs.  This command is used to replicate a


set of HMMs whilst allowing control over which structures will


be shared between them.


⌨️ 快捷键说明

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