#include <sent/stddefs.h>
#include <sent/htk_hmm.h>
#include <sent/htk_param.h>
データ構造 | |
struct | MIXCACHE |
A component of per-codebook probability cache while search [詳細] | |
struct | __hmmwork__ |
Work area and cache for HMM computation [詳細] | |
マクロ定義 | |
#define | TMBEAMWIDTH 5.0 |
Score beam offset for GPRUNE_SEL_BEAM. | |
型定義 | |
typedef __hmmwork__ | HMMWork |
Work area and cache for HMM computation | |
列挙型 | |
enum | { GPRUNE_SEL_UNDEF, GPRUNE_SEL_NONE, GPRUNE_SEL_SAFE, GPRUNE_SEL_HEURISTIC, GPRUNE_SEL_BEAM, GPRUNE_SEL_USER } |
Symbols to specify which Gaussian pruning algorithm to use. [詳細] | |
関数 | |
void | make_log_tbl () |
Generate a value tables of ![]() | |
LOGPROB | addlog (LOGPROB x, LOGPROB y) |
Rapid computation of ![]() | |
LOGPROB | addlog_array (LOGPROB *x, int n) |
Rapid computation of ![]() | |
boolean | outprob_init (HMMWork *wrk, HTK_HMM_INFO *hmminfo, HTK_HMM_INFO *gshmm, int gms_num, int gprune_method, int gprune_mixnum) |
Initialize and setup acoustic computation functions. | |
boolean | outprob_prepare (HMMWork *wrk, int framenum) |
Prepare for the next input of given frame length. | |
void | outprob_free (HMMWork *wrk) |
Free all work area for outprob computation. | |
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. | |
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(). | |
LOGPROB | outprob_cd (HMMWork *wrk, int t, CD_State_Set *lset, HTK_Param *param) |
Compute the log output probability of a pseudo state set. | |
boolean | gms_init (HMMWork *wrk) |
Initialize the GMS related functions and data. | |
boolean | gms_prepare (HMMWork *wrk, int framelen) |
Setup GMS parameters for next input. | |
void | gms_free (HMMWork *wrk) |
Free GMS related work areas. | |
LOGPROB | gms_state (HMMWork *wrk) |
Get HMM State probability of current state with Gaussiam Mixture Selection. | |
void | gms_gprune_init (HMMWork *wrk) |
Initialization of GMS HMM likelihood computation. | |
void | gms_gprune_prepare (HMMWork *wrk) |
Prepare GMS HMM computation for the next speech input. | |
void | gms_gprune_free (HMMWork *wrk) |
Free GMS related work area. | |
void | compute_gs_scores (HMMWork *wrk) |
Main function to compute all the GMS HMM states in a frame with the input vectore specified by OP_vec. | |
LOGPROB | calc_mix (HMMWork *wrk) |
Compute the output probability of current state OP_State. | |
boolean | calc_tied_mix_init (HMMWork *wrk) |
Initialize codebook cache area. | |
boolean | calc_tied_mix_prepare (HMMWork *wrk, int framenum) |
Setup codebook cache for the next incoming input. | |
void | calc_tied_mix_free (HMMWork *wrk) |
Free work area for tied-mixture calculation. | |
LOGPROB | calc_tied_mix (HMMWork *wrk) |
Compute the output probability of current state OP_State on tied-mixture model | |
LOGPROB | calc_compound_mix (HMMWork *wrk) |
Compute the output probability of current state OP_State, regardless of tied-mixture model or state-level mixture PDF. | |
int | cache_push (HMMWork *wrk, int id, LOGPROB score, int len) |
Store a score to the current list of computed Gaussians. | |
LOGPROB | compute_g_base (HMMWork *wrk, HTK_HMM_Dens *binfo) |
Calculate probability of a Gaussian density against input vector on OP_vec. | |
boolean | gprune_none_init (HMMWork *wrk) |
Initialize and setup work area for Gaussian computation | |
void | gprune_none_free (HMMWork *wrk) |
Free gprune_none related work area. | |
void | gprune_none (HMMWork *wrk, HTK_HMM_Dens **g, int num, int *last_id, int lnum) |
Compute a set of Gaussians with no pruning | |
LOGPROB | compute_g_safe (HMMWork *wrk, HTK_HMM_Dens *binfo, LOGPROB thres) |
Calculate probability with safe pruning. | |
boolean | gprune_safe_init (HMMWork *wrk) |
Initialize and setup work area for Gaussian pruning by safe algorithm. | |
void | gprune_safe_free (HMMWork *wrk) |
Free gprune_safe related work area. | |
void | gprune_safe (HMMWork *wrk, HTK_HMM_Dens **g, int gnum, int *last_id, int lnum) |
Compute a set of Gaussians with safe pruning. | |
boolean | gprune_heu_init (HMMWork *wrk) |
Initialize and setup work area for Gaussian pruning by heuristic algorithm. | |
void | gprune_heu_free (HMMWork *wrk) |
Free gprune_heu related work area. | |
void | gprune_heu (HMMWork *wrk, HTK_HMM_Dens **g, int gnum, int *last_id, int lnum) |
Compute a set of Gaussians with heuristic pruning. | |
boolean | gprune_beam_init (HMMWork *wrk) |
Initialize and setup work area for Gaussian pruning by beam algorithm. | |
void | gprune_beam_free (HMMWork *wrk) |
Free gprune_beam related work area. | |
void | gprune_beam (HMMWork *wrk, HTK_HMM_Dens **g, int gnum, int *last_id, int lnum) |
Compute a set of Gaussians with beam pruning. |
hmm_calc.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.
hmm_calc.h の 53 行で定義されています。
参照元 set_dimthres().
anonymous enum |
Symbols to specify which Gaussian pruning algorithm to use.
hmm_calc.h の 44 行で定義されています。
void make_log_tbl | ( | ) |
Generate a value tables of .
is from 0 to (- VRANGE), and table size is TBLSIZE.
参照元 outprob_init().
Rapid computation of .
a | [in] array of log values | |
n | [in] length of above |
boolean outprob_init | ( | HMMWork * | wrk, | |
HTK_HMM_INFO * | hmminfo, | |||
HTK_HMM_INFO * | gshmm, | |||
int | gms_num, | |||
int | gprune_method, | |||
int | gprune_mixnum | |||
) |
Initialize and setup acoustic computation functions.
wrk | [i/o] HMM computation work area | |
hmminfo | [in] HMM definition | |
gshmm | [in] GMS HMM definition if exist, or NULL if not | |
gms_num | [in] number of GMS HMM to compute (valid if gshmm != NULL) | |
gprune_method | [in] gaussian pruning method | |
gprune_mixnum | [in] number of pdf to compute at a codebook in gaussian pruning |
select functions
outprob_init.c の 68 行で定義されています。
参照元 j_final_fusion().
Prepare for the next input of given frame length.
wrk | [i/o] HMM computation work area | |
framenum | [in] input length in frame. |
outprob_init.c の 201 行で定義されています。
参照元 get_back_trellis()・j_recognize_stream_core()・proceed_one_frame()・RealTimePipeLinePrepare()・RealTimeResume().
void outprob_free | ( | HMMWork * | wrk | ) |
Free all work area for outprob computation.
wrk | [i/o] HMM computation work area |
outprob_init.c の 222 行で定義されています。
参照元 j_process_am_free().
Initialize the cache data, should be called once on startup.
wrk | [i/o] HMM computation work area |
参照元 outprob_init().
Prepare cache for the next input, by clearing the existing cache.
wrk | [i/o] HMM computation work area |
参照元 outprob_prepare().
void outprob_cache_free | ( | HMMWork * | wrk | ) |
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 |
参照元 outprob()・outprob_cd_avg()・outprob_cd_max()・outprob_cd_nbest()・outprob_style()・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. |
参照元 outprob_init().
void outprob_cd_nbest_free | ( | HMMWork * | wrk | ) |
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 |
Initialize the GMS related functions and data.
wrk | [i/o] HMM computation work area |
参照元 outprob_init().
Setup GMS parameters for next input.
wrk | [i/o] HMM computation work area | |
framenum | [in] length of next input in frames |
参照元 outprob_prepare().
void gms_free | ( | HMMWork * | wrk | ) |
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.
wrk | [i/o] HMM computation work area |
参照元 outprob_init().
void gms_gprune_init | ( | HMMWork * | wrk | ) |
Initialization of GMS HMM likelihood computation.
wrk | [i/o] HMM computation work area |
gms_gprune.c の 43 行で定義されています。
参照元 gms_init().
void gms_gprune_prepare | ( | HMMWork * | wrk | ) |
Prepare GMS HMM computation for the next speech input.
wrk | [i/o] HMM computation work area |
gms_gprune.c の 59 行で定義されています。
参照元 gms_prepare().
void gms_gprune_free | ( | HMMWork * | wrk | ) |
Free GMS related work area.
wrk | [i/o] HMM computation work area |
gms_gprune.c の 76 行で定義されています。
参照元 gms_free().
void compute_gs_scores | ( | HMMWork * | wrk | ) |
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.
wrk | [i/o] HMM computation work area |
gms_gprune.c の 238 行で定義されています。
参照元 do_gms().
Compute the output probability of current state OP_State.
No codebook-level cache is done.
wrk | [i/o] HMM computation work area |
calc_mix.c の 41 行で定義されています。
参照元 outprob_init().
Initialize codebook cache area.
wrk | [i/o] HMM computation work area |
calc_tied_mix.c の 51 行で定義されています。
参照元 outprob_init().
Setup codebook cache for the next incoming input.
wrk | [i/o] HMM computation work area | |
framenum | [in] length of the next input. |
calc_tied_mix.c の 70 行で定義されています。
参照元 outprob_prepare().
void calc_tied_mix_free | ( | HMMWork * | wrk | ) |
Free work area for tied-mixture calculation.
wrk | [i/o] HMM computation work area |
calc_tied_mix.c の 137 行で定義されています。
参照元 outprob_free().
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.
wrk | [i/o] HMM computation work area |
calc_tied_mix.c の 162 行で定義されています。
参照元 outprob_init().
Compute the output probability of current state OP_State, regardless of tied-mixture model or state-level mixture PDF.
This function switches calculation function of calc_mix() and calc_tied_mix() based on the mixture PDF information. This will be used on a system which has tied-mixture codebook but some states still has their own mixture PDF.
The initialization functions should be the same as calc_tied_mix(), since calc_mix() has no specific initialization.
wrk | [i/o] HMM computation work area |
calc_tied_mix.c の 258 行で定義されています。
参照元 outprob_init().
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.
wrk | [i/o] HMM computation work area | |
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 |
gprune_common.c の 88 行で定義されています。
LOGPROB compute_g_base | ( | HMMWork * | wrk, | |
HTK_HMM_Dens * | binfo | |||
) |
Calculate probability of a Gaussian density against input vector on OP_vec.
wrk | [i/o] HMM computation work area | |
binfo | [in] a Gaussian density |
gprune_none.c の 59 行で定義されています。
Initialize and setup work area for Gaussian computation
wrk | [i/o] HMM computation work area |
gprune_none.c の 92 行で定義されています。
参照元 outprob_init().
void gprune_none_free | ( | HMMWork * | wrk | ) |
Free gprune_none related work area.
wrk | [i/o] HMM computation work area |
gprune_none.c の 110 行で定義されています。
参照元 outprob_init().
void gprune_none | ( | HMMWork * | wrk, | |
HTK_HMM_Dens ** | g, | |||
int | num, | |||
int * | last_id, | |||
int | lnum | |||
) |
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().
wrk | [i/o] HMM computation work area | |
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 | |
lnum | [in] length of last_id |
gprune_none.c の 133 行で定義されています。
参照元 outprob_init().
LOGPROB compute_g_safe | ( | HMMWork * | wrk, | |
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.
wrk | [i/o] HMM computation work area | |
binfo | [in] Gaussian density | |
thres | [in] threshold |
gprune_safe.c の 76 行で定義されています。
参照元 gprune_safe().
Initialize and setup work area for Gaussian pruning by safe algorithm.
wrk | [i/o] HMM computation work area |
gprune_safe.c の 107 行で定義されています。
参照元 outprob_init().
void gprune_safe_free | ( | HMMWork * | wrk | ) |
Free gprune_safe related work area.
wrk | [i/o] HMM computation work area |
gprune_safe.c の 127 行で定義されています。
参照元 outprob_init().
void gprune_safe | ( | HMMWork * | wrk, | |
HTK_HMM_Dens ** | g, | |||
int | gnum, | |||
int * | last_id, | |||
int | lnum | |||
) |
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().
wrk | [i/o] HMM computation work area | |
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 | |
lnum | [in] length of last_id |
gprune_safe.c の 160 行で定義されています。
参照元 outprob_init().
Initialize and setup work area for Gaussian pruning by heuristic algorithm.
wrk | [i/o] HMM computation work area |
gprune_heu.c の 237 行で定義されています。
参照元 outprob_init().
void gprune_heu_free | ( | HMMWork * | wrk | ) |
Free gprune_heu related work area.
wrk | [i/o] HMM computation work area |
gprune_heu.c の 260 行で定義されています。
参照元 outprob_init().
void gprune_heu | ( | HMMWork * | wrk, | |
HTK_HMM_Dens ** | g, | |||
int | gnum, | |||
int * | last_id, | |||
int | lnum | |||
) |
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().
wrk | [i/o] HMM computation work area | |
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 | |
lnum | [in] length of last_id |
gprune_heu.c の 295 行で定義されています。
参照元 outprob_init().
Initialize and setup work area for Gaussian pruning by beam algorithm.
wrk | [i/o] HMM computation work area |
gprune_beam.c の 234 行で定義されています。
参照元 outprob_init().
void gprune_beam_free | ( | HMMWork * | wrk | ) |
Free gprune_beam related work area.
wrk | [i/o] HMM computation work area |
gprune_beam.c の 257 行で定義されています。
参照元 outprob_init().
void gprune_beam | ( | HMMWork * | wrk, | |
HTK_HMM_Dens ** | g, | |||
int | gnum, | |||
int * | last_id, | |||
int | lnum | |||
) |
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().
wrk | [i/o] HMM computation work area | |
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 | |
lnum | [in] length of last_id |
gprune_beam.c の 291 行で定義されています。
参照元 outprob_init().