This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | MIXCACHE |
A component of per-codebook probability cache while search. More... | |
Defines | |
#define | TMBEAMWIDTH 5.0 |
Score beam offset for GPRUNE_SEL_BEAM. | |
Enumerations | |
enum | { GPRUNE_SEL_UNDEF, GPRUNE_SEL_NONE, GPRUNE_SEL_SAFE, GPRUNE_SEL_HEURISTIC, GPRUNE_SEL_BEAM } |
Symbols to specify which Gaussian pruning algorithm to use. More... | |
Functions | |
int | cache_push (int id, LOGPROB score, int len) |
Store a score to the current list of computed Gaussians. | |
LOGPROB | compute_g_base (HTK_HMM_Dens *binfo) |
boolean | gprune_none_init () |
void | gprune_none_free () |
void | gprune_none (HTK_HMM_Dens **g, int num, int *last_id) |
Compute a set of Gaussians with no pruning. | |
LOGPROB | compute_g_safe (HTK_HMM_Dens *binfo, LOGPROB thres) |
Calculate probability with safe pruning. | |
boolean | gprune_safe_init () |
void | gprune_safe_free () |
void | gprune_safe (HTK_HMM_Dens **g, int gnum, int *last_id) |
Compute a set of Gaussians with safe pruning. | |
boolean | gprune_heu_init () |
void | gprune_heu_free () |
void | gprune_heu (HTK_HMM_Dens **g, int gnum, int *last_id) |
Compute a set of Gaussians with heuristic pruning. | |
boolean | gprune_beam_init () |
void | gprune_beam_free () |
void | gprune_beam (HTK_HMM_Dens **g, int gnum, int *last_id) |
Compute a set of Gaussians with beam pruning. |
Definition in file gprune.h.
#define TMBEAMWIDTH 5.0 |
Score beam offset for GPRUNE_SEL_BEAM.
Larger value may ease pruning error, but processing may become slower. Smaller value can speed up the acoustic computation, but may cause error.
Definition at line 57 of file gprune.h.
Referenced by set_dimthres().
anonymous enum |
int cache_push | ( | int | id, | |
LOGPROB | score, | |||
int | len | |||
) |
Store a score to the current list of computed Gaussians.
Store the calculated score of a Gaussian to OP_calced_score, with its corresponding mixture id to OP_calced_id.
The OP_calced_score and OP_calced_id always holds the (OP_gprune_num)-best scores and ids. If the number of stored Gaussian from start has reached OP_gprune_num and the given score is below the bottom, it will be dropped. Else, the new score will be inserted and the bottom will be dropped from the list.
The OP_calced_score will always kept sorted by the scores.
id | [in] mixture id of the Gaussian to store | |
score | [in] score of the Gaussian to store | |
len | [in] current number of stored scores in OP_calced_score |
Definition at line 87 of file gprune_common.c.
Referenced by gprune_beam(), gprune_heu(), and gprune_safe().
LOGPROB compute_g_base | ( | HTK_HMM_Dens * | binfo | ) |
Calculate probability of a Gaussian density against input vector on OP_vec.
binfo | [in] a Gaussian density |
Definition at line 58 of file gprune_none.c.
Referenced by compute_gs_scores(), gprune_beam(), gprune_heu(), gprune_none(), and gprune_safe().
boolean gprune_none_init | ( | ) |
Initialize and setup work area for Gaussian computation
Definition at line 84 of file gprune_none.c.
Referenced by outprob_init().
void gprune_none_free | ( | ) |
Free gprune_none related work area.
Definition at line 100 of file gprune_none.c.
Referenced by outprob_init().
void gprune_none | ( | HTK_HMM_Dens ** | g, | |
int | num, | |||
int * | last_id | |||
) |
Compute a set of Gaussians with no pruning.
The calculated scores will be stored to OP_calced_score, with its corresponding mixture id to OP_calced_id. The number of calculated mixtures is also stored in OP_calced_num.
This can be called from calc_tied_mix() or calc_mix().
g | [in] set of Gaussian densities to compute the output probability. | |
num | [in] length of above | |
last_id | [in] ID list of N-best mixture in previous input frame, or NULL if not exist |
Definition at line 121 of file gprune_none.c.
Referenced by outprob_init().
LOGPROB compute_g_safe | ( | HTK_HMM_Dens * | binfo, | |
LOGPROB | thres | |||
) |
Calculate probability with safe pruning.
Calculate probability of a Gaussian toward OP_vec, performing pruning using the scholar threshold.
binfo | [in] Gaussian density | |
thres | [in] threshold |
Definition at line 77 of file gprune_safe.c.
Referenced by gprune_beam(), gprune_heu(), and gprune_safe().
boolean gprune_safe_init | ( | ) |
Initialize and setup work area for Gaussian pruning by safe algorithm.
Definition at line 106 of file gprune_safe.c.
Referenced by outprob_init().
void gprune_safe_free | ( | ) |
Free gprune_safe related work area.
Definition at line 123 of file gprune_safe.c.
Referenced by outprob_init().
void gprune_safe | ( | HTK_HMM_Dens ** | g, | |
int | gnum, | |||
int * | last_id | |||
) |
Compute a set of Gaussians with safe pruning.
If the N-best mixtures in the previous frame is specified in last_id, They are first computed to set the initial threshold. After that, the rest of the Gaussians will be computed with the thresholds to drop unpromising Gaussians from computation at early stage of likelihood computation. If the computation of a Gaussian reached to the end, the threshold will be updated to always hold the likelihood of current N-best score.
The calculated scores will be stored to OP_calced_score, with its corresponding mixture id to OP_calced_id. These are done by calling cache_push(). The number of calculated mixtures is also stored in OP_calced_num.
This can be called from calc_tied_mix() or calc_mix().
g | [in] set of Gaussian densities to compute the output probability | |
gnum | [in] length of above | |
last_id | [in] ID list of N-best mixture in previous input frame, or NULL if not exist |
Definition at line 154 of file gprune_safe.c.
Referenced by outprob_init().
boolean gprune_heu_init | ( | ) |
Initialize and setup work area for Gaussian pruning by heuristic algorithm.
Definition at line 235 of file gprune_heu.c.
Referenced by outprob_init().
void gprune_heu_free | ( | ) |
Free gprune_heu related work area.
Definition at line 255 of file gprune_heu.c.
Referenced by outprob_init().
void gprune_heu | ( | HTK_HMM_Dens ** | g, | |
int | gnum, | |||
int * | last_id | |||
) |
Compute a set of Gaussians with heuristic pruning.
If the N-best mixtures in the previous frame is specified in last_id, They are first computed to get the maximum value for each dimension. After that, the rest of the Gaussians will be computed using the maximum values as heuristics of uncomputed dimensions to drop unpromising Gaussians from computation at early stage of likelihood computation. If the last_id is not specified (typically at the first frame of the input), a safe pruning as same as one in gprune_safe.c will be applied.
The calculated scores will be stored to OP_calced_score, with its corresponding mixture id to OP_calced_id. These are done by calling cache_push(). The number of calculated mixtures is also stored in OP_calced_num.
This can be called from calc_tied_mix() or calc_mix().
g | [in] set of Gaussian densities to compute the output probability | |
gnum | [in] length of above | |
last_id | [in] ID list of N-best mixture in previous input frame, or NULL if not exist |
Definition at line 288 of file gprune_heu.c.
Referenced by outprob_init().
boolean gprune_beam_init | ( | ) |
Initialize and setup work area for Gaussian pruning by beam algorithm.
Definition at line 225 of file gprune_beam.c.
Referenced by outprob_init().
void gprune_beam_free | ( | ) |
Free gprune_beam related work area.
Definition at line 245 of file gprune_beam.c.
Referenced by outprob_init().
void gprune_beam | ( | HTK_HMM_Dens ** | g, | |
int | gnum, | |||
int * | last_id | |||
) |
Compute a set of Gaussians with beam pruning.
If the N-best mixtures in the previous frame is specified in last_id, They are first computed to set the thresholds for each dimension. After that, the rest of the Gaussians will be computed with those dimension thresholds to drop unpromising Gaussians from computation at early stage of likelihood computation. If the last_id is not specified (typically at the first frame of the input), a safe pruning as same as one in gprune_safe.c will be applied.
The calculated scores will be stored to OP_calced_score, with its corresponding mixture id to OP_calced_id. These are done by calling cache_push(). The number of calculated mixtures is also stored in OP_calced_num.
This can be called from calc_tied_mix() or calc_mix().
g | [in] set of Gaussian densities to compute the output probability | |
gnum | [in] length of above | |
last_id | [in] ID list of N-best mixture in previous input frame, or NULL if not exist |
Definition at line 277 of file gprune_beam.c.
Referenced by outprob_init().