#include <sent/stddefs.h>
#include <sent/speech.h>
#include <sent/htk_hmm.h>
#include <sent/htk_param.h>
#include <sent/hmm.h>
#include <sent/hmm_calc.h>
Go to the source code of this file.
Defines | |
#define | LOG_UNDEF (LOG_ZERO - 1) |
Value to be used as the initial cache value. | |
Functions | |
boolean | outprob_cache_init (HMMWork *wrk) |
Initialize the cache data, should be called once on startup. | |
boolean | outprob_cache_prepare (HMMWork *wrk) |
Prepare cache for the next input, by clearing the existing cache. | |
static void | outprob_cache_extend (HMMWork *wrk, int reqframe) |
Expand the cache to time axis if needed. | |
void | outprob_cache_free (HMMWork *wrk) |
Free work area for cache. | |
LOGPROB | outprob_state (HMMWork *wrk, int t, HTK_HMM_State *stateinfo, HTK_Param *param) |
Compute output probability of a state. | |
void | outprob_cd_nbest_init (HMMWork *wrk, int num) |
Initialize work area for outprob_cd_nbest(). | |
void | outprob_cd_nbest_free (HMMWork *wrk) |
Free work area for outprob_cd_nbest(). | |
static LOGPROB | outprob_cd_nbest (HMMWork *wrk, int t, CD_State_Set *lset, HTK_Param *param) |
Return average of N-beat outprob for pseudo state set. | |
static LOGPROB | outprob_cd_max (HMMWork *wrk, int t, CD_State_Set *lset, HTK_Param *param) |
Return maximum outprob of the pseudo state set. | |
static LOGPROB | outprob_cd_avg (HMMWork *wrk, int t, CD_State_Set *lset, HTK_Param *param) |
Return average outprob of the pseudo state set. | |
LOGPROB | outprob_cd (HMMWork *wrk, int t, CD_State_Set *lset, HTK_Param *param) |
Compute the log output probability of a pseudo state set. | |
LOGPROB | outprob (HMMWork *wrk, int t, HMM_STATE *hmmstate, HTK_Param *param) |
Top function to compute the output probability of a HMM state. |
This file defines functions to compute output log probability of HMM state. Several functions are defined for each state type (whether it is on word edge and a part of pseudo HMM), and all of them calls outprob_state() to get the log probability of a HMM state. The outprob_state() will 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 scores will be cached here. The 2-dimension cache array of state and input frame are used to store the computed scores. They will be expanded when needed. Thus the scores will be cached for all input frame because they will also be used in the 2nd pass of recognition process.
When using a tied-mixture model, codebook-level cache will be also done in addition to this state-level cache. See calc_tied_mix.c for details.
Definition in file outprob.c.
Initialize the cache data, should be called once on startup.
wrk | [i/o] HMM computation work area |
Definition at line 78 of file outprob.c.
Referenced by outprob_init().
Prepare cache for the next input, by clearing the existing cache.
wrk | [i/o] HMM computation work area |
Definition at line 96 of file outprob.c.
Referenced by outprob_prepare().
static void outprob_cache_extend | ( | HMMWork * | wrk, | |
int | reqframe | |||
) | [static] |
Expand the cache to time axis if needed.
wrk | [i/o] HMM computation work area | |
reqframe | [in] required frame length |
Definition at line 117 of file outprob.c.
Referenced by outprob_state().
void outprob_cache_free | ( | HMMWork * | wrk | ) |
Free work area for cache.
wrk | [i/o] HMM computation work area |
Definition at line 158 of file outprob.c.
Referenced by outprob_free().
LOGPROB outprob_state | ( | HMMWork * | wrk, | |
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.
wrk | [i/o] HMM computation work area | |
t | [in] time frame | |
stateinfo | [in] state information to compute the output probability | |
param | [in] input parameter vectors |
Definition at line 184 of file outprob.c.
Referenced by outprob(), outprob_cd_avg(), outprob_cd_max(), outprob_cd_nbest(), outprob_style(), and start_word().
void outprob_cd_nbest_init | ( | HMMWork * | wrk, | |
int | num | |||
) |
Initialize work area for outprob_cd_nbest().
wrk | [i/o] HMM computation work area | |
num | [in] number of top states to be calculated. |
Definition at line 222 of file outprob.c.
Referenced by outprob_init().
void outprob_cd_nbest_free | ( | HMMWork * | wrk | ) |
Free work area for outprob_cd_nbest().
wrk | [i/o] HMM computation work area |
Definition at line 235 of file outprob.c.
Referenced by outprob_free().
static LOGPROB outprob_cd_nbest | ( | HMMWork * | wrk, | |
int | t, | |||
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) | [static] |
Return average of N-beat outprob for pseudo state set.
wrk | [i/o] HMM computation work area | |
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
Definition at line 251 of file outprob.c.
Referenced by outprob_cd().
static LOGPROB outprob_cd_max | ( | HMMWork * | wrk, | |
int | t, | |||
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) | [static] |
Return maximum outprob of the pseudo state set.
wrk | [i/o] HMM computation work area | |
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
Definition at line 296 of file outprob.c.
Referenced by outprob_cd().
static LOGPROB outprob_cd_avg | ( | HMMWork * | wrk, | |
int | t, | |||
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) | [static] |
Return average outprob of the pseudo state set.
wrk | [i/o] HMM computation work area | |
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
Definition at line 320 of file outprob.c.
Referenced by outprob_cd().
LOGPROB outprob_cd | ( | HMMWork * | wrk, | |
int | t, | |||
CD_State_Set * | lset, | |||
HTK_Param * | param | |||
) |
Compute the log output probability of a pseudo state set.
wrk | [i/o] HMM computation work area | |
t | [in] input frame | |
lset | [in] pseudo state set | |
param | [in] input parameter data |
Definition at line 347 of file outprob.c.
Referenced by outprob(), outprob_style(), and start_word().
Top function to compute the output probability of a HMM state.
wrk | [i/o] HMM computation work area | |
t | [in] input frame | |
hmmstate | [in] HMM state | |
param | [in] input parameter data |
Definition at line 378 of file outprob.c.
Referenced by viterbi_segment().