libsent/include/sent/hmm.h

認識計算用の Hidden Marcov Model [詳細]

#include <sent/stddefs.h>
#include <sent/htk_hmm.h>
#include <sent/htk_param.h>
hmm.hのインクルード依存関係図
このグラフは、どのファイルから直接、間接的にインクルードされているかを示しています。

ソースコードを見る。

データ構造

struct  _a_cell
 Transition arc of HMM state. [詳細]
struct  HMM_STATE
 HMM State [詳細]
struct  HMM
 HMM state sequence [詳細]
struct  _seg_token

型定義

typedef struct _a_cell A_CELL
 Transition arc of HMM state.
typedef struct _seg_token SEGTOKEN

関数

HMMnew_make_word_hmm (HTK_HMM_INFO *, HMM_Logical **, int)
HMMnew_make_word_hmm_with_lm (HTK_HMM_INFO *, HMM_Logical **, int, LOGPROB *)
void free_hmm (HMM *)
LOGPROB viterbi_segment (HMM *hmm, HTK_Param *param, int *endstates, int ulen, int **id_ret, int **seg_ret, LOGPROB **uscore_ret, int *retlen)
 Perform Viterbi alignment.
void make_log_tbl ()
 Generate a value tables of $\log (1+e^x)$.
LOGPROB addlog (LOGPROB x, LOGPROB y)
LOGPROB addlog_array (LOGPROB *x, int n)
boolean outprob_init (HTK_HMM_INFO *hmminfo, HTK_HMM_INFO *gshmm, int gms_num, int gprune_method, int gprune_mixnum)
boolean outprob_prepare (int framenum)
void outprob_free ()
boolean outprob_cache_init ()
boolean outprob_cache_prepare ()
void outprob_cache_free ()
LOGPROB outprob_state (int t, HTK_HMM_State *stateinfo, HTK_Param *param)
 Compute output probability of a state.
void outprob_cd_nbest_init (int num)
void outprob_cd_nbest_free ()
LOGPROB outprob_cd (int t, CD_State_Set *lset, HTK_Param *param)
LOGPROB outprob (int t, HMM_STATE *hmmstate, HTK_Param *param)
boolean gms_init (int nbest)
boolean gms_prepare (int framelen)
void gms_free ()
LOGPROB gms_state ()
void gms_gprune_init (HTK_HMM_INFO *hmminfo, int gsset_num)
void gms_gprune_prepare ()
void gms_gprune_free ()
void compute_gs_scores (GS_SET *gsset, int gsset_num, LOGPROB *scores_ret)
LOGPROB calc_mix ()
 Compute the output probability of current state OP_State.
boolean calc_tied_mix_init ()
boolean calc_tied_mix_prepare (int framenum)
void calc_tied_mix_free ()
LOGPROB calc_tied_mix ()
 Compute the output probability of current state OP_State on tied-mixture model.
void put_hmm_arc (HMM *d)
void put_hmm_outprob (HMM *d)
void put_hmm (HMM *d)

説明

認識計算用の Hidden Marcov Model

作者:
Akinobu LEE
日付:
Thu Feb 10 14:54:06 2005

このファイルでは, 認識におけるHMMの構造体を定義しています. 認識時には, 辞書および音響モデル構造体 (htk_hmm.h) を元に 必要な単語HMMや木構造化辞書がこの構造体を用いて構築され, 音響尤度計算はこの上で行われます.

Revision
1.4

hmm.h で定義されています。


型定義

typedef struct _seg_token SEGTOKEN

Token definition for viterbi segmentation.


関数

HMM* new_make_word_hmm ( HTK_HMM_INFO hmminfo,
HMM_Logical **  hdseq,
int  hdseqlen 
)

Make a HMM instance for recognition from phoneme sequence.

引数:
hmminfo [in] HTK HMM definitions data
hdseq [in] phoneme sequence as given by pointer list of logical HMM
hdseqlen [in] length of above
戻り値:
newly allocated HMM instance generated from the given data.

mkwhmm.c362 行で定義されています。

参照元 do_align(), と scan_word().

HMM* new_make_word_hmm_with_lm ( HTK_HMM_INFO hmminfo,
HMM_Logical **  hdseq,
int  hdseqlen,
LOGPROB lscore 
)

Make a HMM instance for recognition from phoneme sequence, with connection probabiliry given for each phoneme.

引数:
hmminfo [in] HTK HMM definitions data
hdseq [in] phoneme sequence as given by pointer list of logical HMM
hdseqlen [in] length of above
lscore [in] list of log probability to be added at the emitting transition of each phoneme, or NULL if not needed.
戻り値:
newly allocated HMM instance generated from the given data.

mkwhmm.c102 行で定義されています。

参照元 new_make_word_hmm().

void free_hmm ( HMM d  ) 

Free an HMM instance.

引数:
d [in] HMM instance to free

mkwhmm.c381 行で定義されています。

参照元 do_align(), と scan_word().

LOGPROB viterbi_segment ( HMM hmm,
HTK_Param param,
int *  endstates,
int  ulen,
int **  id_ret,
int **  seg_ret,
LOGPROB **  uscore_ret,
int *  slen_ret 
)

Perform Viterbi alignment.

This function performs viterbi alignment for the given sentence HMM, input parameter and unit definition. Any segmentatino unit (word, phoneme state, etc.) is allowed: the segmentation unit should be specified by specifying a list of state id which are the end of each unit. For example, if you want to obtain phoneme alignment, the list of state number that exist at the end of phones should be specified by endstates.

引数:
hmm [in] sentence HMM to be matched
param [in] input parameter data
endstates [in] list of state id that corrsponds to the ends of units
ulen [in] total number of units in the hmm
id_ret [out] Pointer to store the newly allocated array of the resulting id sequence of units on the best path.
seg_ret [out] Pointer to store the newly allocated array of the resulting end frame of each unit on the best path.
uscore_ret [out] Pointer to store the newly allocated array of the resulting score at the end frame of each unit on the best path.
slen_ret [out] Pointer to store the total number of units on the best path.
戻り値:
the total acoustic score for the whole input.

vsegment.c50 行で定義されています。

参照元 do_align().

void make_log_tbl (  ) 

Generate a value tables of $\log (1+e^x)$.

$x$ is from 0 to (- VRANGE), and table size is TBLSIZE.

addlog.c41 行で定義されています。

参照元 outprob_init().

LOGPROB addlog ( LOGPROB  x,
LOGPROB  y 
)

Rapid computation of $\log (e^x + e^y)$.

If value differs more than LOG_ADDMIN, the larger value will be returned as is.

引数:
x [in] log value
y [in] log value
戻り値:
result value.

addlog.c70 行で定義されています。

LOGPROB addlog_array ( LOGPROB a,
int  n 
)

Rapid computation of $\log (\sum_{i=1}^N e^{x_i})$.

引数:
a [in] array of log values
n [in] length of above
戻り値:
the result value.

addlog.c102 行で定義されています。

参照元 calc_mix(), calc_tied_mix(), と gmm_calc_mix().

boolean outprob_init ( HTK_HMM_INFO hmminfo,
HTK_HMM_INFO gshmm,
int  gms_num,
int  gprune_method,
int  gprune_mixnum 
)

Initialize and setup acoustic computation functions.

戻り値:
TRUE on success, FALSE on failure.

select functions

outprob_init.c62 行で定義されています。

参照元 final_fusion().

boolean outprob_prepare ( int  framenum  ) 

Prepare for the next input of given frame length.

引数:
framenum [in] input length in frame.
戻り値:
TRUE on success, FALSE on failure.

outprob_init.c158 行で定義されています。

参照元 main_recognition_loop(), と RealTimePipeLinePrepare().

void outprob_free (  ) 

Free all work area for outprob computation.

outprob_init.c177 行で定義されています。

boolean outprob_cache_init (  ) 

Initialize the cache data, should be called once on startup.

戻り値:
TRUE on success, FALSE on failure.

outprob.c82 行で定義されています。

参照元 outprob_init().

boolean outprob_cache_prepare (  ) 

Prepare cache for the next input, by clearing the existing cache.

戻り値:
TRUE on success, FALSE on failure.

outprob.c100 行で定義されています。

参照元 outprob_prepare().

void outprob_cache_free (  ) 

Free work area for cache.

outprob.c159 行で定義されています。

参照元 outprob_free().

LOGPROB outprob_state ( int  t,
HTK_HMM_State stateinfo,
HTK_Param param 
)

Compute output probability of a state.

Set the needed values to the global variables that begins with "OP_", and call calc_outprob_state(). The calc_outprob_state() is actually a function pointer, and the entity is either calc_tied_mix() for tied-mixture model and calc_mix() for others. (If you use GMS, the entity will be gms_state() instead.)

The state-level cache is also consulted here.

戻り値:
output log probability.

outprob.c180 行で定義されています。

参照元 next_word(), outprob(), outprob_cd_avg(), outprob_cd_max(), outprob_cd_nbest(), outprob_style(), と start_word().

void outprob_cd_nbest_init ( int  num  ) 

Initialize work area for outprob_cd_nbest().

引数:
num [in] number of top states to be calculated.

outprob.c217 行で定義されています。

参照元 outprob_init().

void outprob_cd_nbest_free (  ) 

Free work area for outprob_cd_nbest().

outprob.c228 行で定義されています。

参照元 outprob_free().

LOGPROB outprob_cd ( int  t,
CD_State_Set lset,
HTK_Param param 
)

Compute the log output probability of a pseudo state set.

引数:
t [in] input frame
lset [in] pseudo state set
param [in] input parameter data
戻り値:
the computed log output probability.

outprob.c335 行で定義されています。

参照元 next_word(), outprob(), outprob_style(), と start_word().

LOGPROB outprob ( int  t,
HMM_STATE hmmstate,
HTK_Param param 
)

Top function to compute the output probability of a HMM state.

引数:
t [in] input frame
hmmstate [in] HMM state
param [in] input parameter data
戻り値:
the computed log output probability.

outprob.c369 行で定義されています。

参照元 scan_word(), と viterbi_segment().

boolean gms_init ( int  nbest  ) 

Initialize the GMS related functions and data.

引数:
nbest [in] N-best state to compute the precise triphone.
戻り値:
TRUE on success, FALSE on failure.

gms.c282 行で定義されています。

参照元 outprob_init().

boolean gms_prepare ( int  framenum  ) 

Setup GMS parameters for next input.

引数:
framenum [in] length of next input in frames
戻り値:
TRUE on success, FALSE on failure.

gms.c332 行で定義されています。

参照元 outprob_prepare().

void gms_free (  ) 

Free GMS related work areas.

gms.c366 行で定義されています。

参照元 outprob_free().

LOGPROB gms_state (  ) 

Get HMM State probability of current state with Gaussiam Mixture Selection.

If the GMS HMM score of the corresponding basephone is below the N-best, the triphone score will not be computed, and the score of the GMS HMM will be returned instead as a fallback score. Else, the precise triphone will be computed and returned.

戻り値:
the state output probability score in log10.

gms.c392 行で定義されています。

参照元 outprob_init().

void gms_gprune_init ( HTK_HMM_INFO hmminfo,
int  gsset_num 
)

Initialization of GMS HMM likelihood computation.

引数:
hmminfo [in] GMS HMM definition
gsset_num [in] number of states in GMS HMM

gms_gprune.c60 行で定義されています。

参照元 gms_init().

void gms_gprune_prepare (  ) 

Prepare GMS HMM computation for the next speech input.

gms_gprune.c75 行で定義されています。

参照元 gms_prepare().

void gms_gprune_free (  ) 

Free GMS related work area.

gms_gprune.c88 行で定義されています。

参照元 gms_free().

void compute_gs_scores ( GS_SET gsset,
int  gsset_num,
LOGPROB scores_ret 
)

Main function to compute all the GMS HMM states in a frame with the input vectore specified by OP_vec. This function assumes that this will be called for sequencial frame, since it utilizes the result of previous frame for faster pruning.

引数:
gsset [in] list of GMS HMM state set.
gsset_num [in] length of above
scores_ret [out] array of scores for each GMS HMM state

gms_gprune.c306 行で定義されています。

参照元 do_gms().

LOGPROB calc_mix (  ) 

Compute the output probability of current state OP_State.

No codebook-level cache is done.

戻り値:
the output probability of the state OP_State in log10

calc_mix.c39 行で定義されています。

参照元 outprob_init().

boolean calc_tied_mix_init (  ) 

Initialize codebook cache area.

戻り値:
TRUE on success, FALSE on failure.

calc_tied_mix.c57 行で定義されています。

参照元 outprob_init().

boolean calc_tied_mix_prepare ( int  framenum  ) 

Setup codebook cache for the next incoming input.

引数:
framenum [in] length of the next input.
戻り値:
TRUE on success, FALSE on failure.

calc_tied_mix.c73 行で定義されています。

参照元 outprob_prepare().

void calc_tied_mix_free (  ) 

Free work area for tied-mixture calculation.

calc_tied_mix.c113 行で定義されています。

参照元 outprob_free().

LOGPROB calc_tied_mix (  ) 

Compute the output probability of current state OP_State on tied-mixture model.

This function assumes that the OP_state is assigned to a tied-mixture codebook. Here the output probability of Gaussian mixture component referred by OP_state is consulted to the book level cache, and if not computed yet on that input frame time, it will be computed here.

戻り値:
the computed output probability in log10.

calc_tied_mix.c138 行で定義されています。

参照元 outprob_init().

void put_hmm_arc ( HMM d  ) 

Output transition arcs of an HMM instance.

引数:
d [in] pointer to a HMM instance.

put_htkdata_info.c160 行で定義されています。

参照元 put_hmm().

void put_hmm_outprob ( HMM d  ) 

Output output probability information of an HMM instance.

引数:
d [in] pointer to a HMM instance.

put_htkdata_info.c183 行で定義されています。

参照元 put_hmm().

void put_hmm ( HMM d  ) 

Output an HMM instance.

引数:
d [in] pointer to a HMM instance.

put_htkdata_info.c204 行で定義されています。


Juliusに対してTue Sep 22 00:14:37 2009に生成されました。  doxygen 1.6.0