#include <julius.h>
Include dependency graph for gmm.c:
Go to the source code of this file.
Functions | |
static int | gmm_find_insert_point (LOGPROB score, int len) |
static int | gmm_cache_push (int id, LOGPROB score, int len) |
static LOGPROB | gmm_compute_g_base (HTK_HMM_Dens *binfo) |
static LOGPROB | gmm_compute_g_safe (HTK_HMM_Dens *binfo, LOGPROB thres) |
static void | gmm_gprune_safe_init (HTK_HMM_INFO *hmminfo, int prune_num) |
static void | gmm_gprune_safe (HTK_HMM_Dens **g, int gnum) |
Compute scores for a set of Gaussians with Gaussian pruning for the current frame. | |
static LOGPROB | gmm_calc_mix (HTK_HMM_State *s) |
static LOGPROB | outprob_state_nocache (int t, HTK_HMM_State *stateinfo, HTK_Param *param) |
void | gmm_init (HTK_HMM_INFO *gmm, int gmm_prune_num) |
void | gmm_prepare (HTK_HMM_INFO *gmm) |
void | gmm_proceed (HTK_HMM_INFO *gmm, HTK_Param *param, int t) |
void | gmm_end (HTK_HMM_INFO *gmm) |
Finish the GMM computation for an input, and output the result. | |
boolean | gmm_valid_input () |
void | ttyout_gmm () |
void | msock_gmm () |
Variables | |
static LOGPROB * | gmm_score |
Current accumurated scores for each GMM. | |
static int | framecount |
Current frame count. | |
static LOGPROB * | OP_calced_score |
Work area for Gaussian pruning on GMM: scores. | |
static int * | OP_calced_id |
Work area for Gaussian pruning on GMM: id. | |
static int | OP_calced_num |
Work area for Gaussian pruning on GMM: number of above. | |
static int | OP_calced_maxnum |
Work area for Gaussian pruning on GMM: size of allocated area. | |
static int | OP_gprune_num |
Number of Gaussians to be computed in Gaussian pruning. | |
static VECT * | OP_vec |
Local workarea to hold the input vector of current frame. | |
static short | OP_veclen |
Local workarea to hold the length of above. | |
static HTK_HMM_Data * | max_d |
Local workarea to hold the pointer to GMM which resulted in the maximum score. | |
static LOGPROB | gmm_max_cm |
Local workarea to hold the posterior probability based confidence score of the maximum GMM above. | |
static HTK_HMM_INFO * | gmm_local |
Local workarea to hold the GMM definition used in the computation, for result output. |
Gaussian pruning is performed using the safe algorithm in the computation of GMM scores. In each frame, pruning will be done to fully compute only the top N Gaussians. The algorithm is slightly simpler than AM computation, i.e. the score order of the previous frame is not used here.
Definition in file gmm.c.
static int gmm_find_insert_point | ( | LOGPROB | score, | |
int | len | |||
) | [static] |
Return insertion point where a computed Gaussian score should be inserted in current list of computed Gaussians.
score | [in] a score to be inserted | |
len | [in] current length of the list |
Definition at line 83 of file gmm.c.
Referenced by gmm_cache_push().
static int gmm_cache_push | ( | int | id, | |
LOGPROB | score, | |||
int | len | |||
) | [static] |
Store a Gaussian likelihood to the list of computed Gaussians.
id | [in] id of a Gaussian in the GMM to be stored | |
score | [in] the likelihood of the Gaussian to be stored | |
len | [in] current list length (= current number of Gaussians in cache) |
Definition at line 122 of file gmm.c.
Referenced by gmm_gprune_safe().
static LOGPROB gmm_compute_g_base | ( | HTK_HMM_Dens * | binfo | ) | [static] |
Compute an output probability of a Gaussian for the input vector of current frame. No Gaussian pruning is performed in this function.
binfo | [in] Gaussian |
Definition at line 176 of file gmm.c.
Referenced by gmm_gprune_safe().
static LOGPROB gmm_compute_g_safe | ( | HTK_HMM_Dens * | binfo, | |
LOGPROB | thres | |||
) | [static] |
Compute an output probability of a Gaussian for the input vector of current frame. Safe pruning is performed in this function.
binfo | [in] Gaussian | |
thres | [in] pruning threshold for safe pruning |
Definition at line 216 of file gmm.c.
Referenced by gmm_gprune_safe().
static void gmm_gprune_safe_init | ( | HTK_HMM_INFO * | hmminfo, | |
int | prune_num | |||
) | [static] |
Allocate work area for Gaussian pruning for GMM calculation.
hmminfo | [in] HMM structure | |
prune_num | [in] number of top Gaussians to be computed at the pruning |
Definition at line 252 of file gmm.c.
Referenced by gmm_init().
static void gmm_gprune_safe | ( | HTK_HMM_Dens ** | g, | |
int | gnum | |||
) | [static] |
Compute scores for a set of Gaussians with Gaussian pruning for the current frame.
Gaussian pruning will be performed to guarantee only the top N Gaussians to be fully computed. The results will be stored in the list of computed Gaussians in OP_calced_score and OP_calced_id.
g | [in] set of Gaussians | |
gnum | [in] length of g |
Definition at line 289 of file gmm.c.
Referenced by gmm_calc_mix().
static LOGPROB gmm_calc_mix | ( | HTK_HMM_State * | s | ) | [static] |
Compute the output probability of a GMM state for the current frame.
s | [in] GMM state |
Definition at line 326 of file gmm.c.
Referenced by outprob_state_nocache().
static LOGPROB outprob_state_nocache | ( | int | t, | |
HTK_HMM_State * | stateinfo, | |||
HTK_Param * | param | |||
) | [static] |
Main function to compute the output probability of a GMM state for the specified input frame.
t | [in] time frame on which the output probability should be computed | |
stateinfo | [in] GMM state | |
param | [in] input vector sequence |
Definition at line 368 of file gmm.c.
Referenced by gmm_proceed().
void gmm_init | ( | HTK_HMM_INFO * | gmm, | |
int | gmm_prune_num | |||
) |
Initialization for computing GMM likelihoods. This will be called once on startup.
gmm | [in] GMM definition structure | |
gmm_prune_num | [in] number of Gaussians which is guaranteed to be fully computed on Gaussian pruning |
Definition at line 397 of file gmm.c.
Referenced by initialize_GMM().
void gmm_prepare | ( | HTK_HMM_INFO * | gmm | ) |
Prepare for the next GMM computation. This will be called just before an input begins.
gmm | [in] GMM definition structure |
Definition at line 444 of file gmm.c.
Referenced by get_back_trellis_init().
void gmm_proceed | ( | HTK_HMM_INFO * | gmm, | |
HTK_Param * | param, | |||
int | t | |||
) |
void gmm_end | ( | HTK_HMM_INFO * | gmm | ) |
Finish the GMM computation for an input, and output the result.
The GMM of the maximum score is finally determined from the accumulated scores computed by gmm_proceed(), and compute the confidence score of the maximum GMM using posterior probability. Then the result will be output using result_gmm().
gmm | [in] GMM definition structure. |
Definition at line 520 of file gmm.c.
Referenced by finalize_1st_pass().
boolean gmm_valid_input | ( | ) |
Return whether the last input was valid or invalid, from the result of GMM computation.
Definition at line 570 of file gmm.c.
Referenced by main_recognition_loop(), and RealTimeCMNUpdate().
void ttyout_gmm | ( | ) |
Output result of GMM computation to standard out. (for "-result tty" option)
Definition at line 592 of file gmm.c.
Referenced by setup_result_tty().
void msock_gmm | ( | ) |
Send the result of GMM computation to module client. (for "-result msock" option)
Definition at line 630 of file gmm.c.
Referenced by setup_result_msock().