julius/gmm.c File Reference

Compute scores using Gaussian Mixture Model. More...

#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 LOGPROBgmm_score
 Current accumurated scores for each GMM.
static int framecount
 Current frame count.
static LOGPROBOP_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 VECTOP_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_Datamax_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_INFOgmm_local
 Local workarea to hold the GMM definition used in the computation, for result output.


Detailed Description

Compute scores using Gaussian Mixture Model.

Author:
Akinobu LEE
Date:
Tue Mar 15 05:14:10 2005
When a Gaussian Mixture Model (GMM) is specified on startup, Julius/Julian will compute the frame-wise likelihoods of each GMM for given inputs, and produces the accumulated scores for each. Then the input rejection is determined from the value. Actually, the recognition will be computed on-line concurrently with the 1st pass, and the result will be got as soon as the 1st pass ends.

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.

Revision
1.5

Definition in file gmm.c.


Function Documentation

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.

Parameters:
score [in] a score to be inserted
len [in] current length of the list
Returns:
index to insert the value at 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.

Parameters:
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)
Returns:
the current length of list after the storing.

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.

Parameters:
binfo [in] Gaussian
Returns:
the log output probability.

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.

Parameters:
binfo [in] Gaussian
thres [in] pruning threshold for safe pruning
Returns:
the log output probability.

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.

Parameters:
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.

Parameters:
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.

Parameters:
s [in] GMM state
Returns:
the log probability.

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.

Parameters:
t [in] time frame on which the output probability should be computed
stateinfo [in] GMM state
param [in] input vector sequence
Returns:
the log output probability.

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.

Parameters:
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.

Parameters:
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 
)

Compute output probabilities of all GMM for a given input vector, and accumulate the results to the gmm_score buffer.

Parameters:
gmm [in] GMM definition structure
param [in] input vectors
t [in] time frame to compute the probabilities.

Definition at line 477 of file gmm.c.

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().

Parameters:
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.

Returns:
TRUE if input is valid, i.e. the name of maximum GMM is not included in gmm_reject_cmn_string, or FALSE if input is invalid, i.e. the name is included in that string.

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().


Generated on Tue Dec 26 16:16:43 2006 for Julius by  doxygen 1.5.0