#include <sent/stddefs.h>
#include <sent/htk_hmm.h>
#include <sent/htk_param.h>
#include <sent/hmm.h>
#include <sent/gprune.h>
#include "globalvars.h"
Include dependency graph for gprune_beam.c:
Go to the source code of this file.
Functions | |
static void | clear_dimthres () |
static void | set_dimthres () |
static LOGPROB | compute_g_beam_updating (HTK_HMM_Dens *binfo) |
Calculate probability with threshold update. | |
static LOGPROB | compute_g_beam_pruning (HTK_HMM_Dens *binfo) |
Calculate probability with 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. | |
Variables | |
static LOGPROB * | dimthres |
Threshold for each dimension (inversed). | |
static int | dimthres_num |
Length of above. | |
static boolean * | mixcalced |
Mark which Gaussian has been computed. |
The beam pruning is the most aggressive pruning method. This is the fastest method, but they may miss the N-best Gaussian to be found, which may result in some likelihood error.
gprune_beam() will be used by calling outprob_init() to set its pointer to the global variable compute_gaussset. Then it will be called from calc_tied_mix() or calc_mix().
Definition in file gprune_beam.c.
static void clear_dimthres | ( | ) | [static] |
Clear per-dimension thresholds.
Definition at line 127 of file gprune_beam.c.
Referenced by gprune_beam().
static void set_dimthres | ( | ) | [static] |
Set beam thresholds by adding TMBEAMWIDTH to the maximum values of each dimension.
Definition at line 139 of file gprune_beam.c.
Referenced by gprune_beam().
static LOGPROB compute_g_beam_updating | ( | HTK_HMM_Dens * | binfo | ) | [static] |
Calculate probability with threshold update.
Calculate probability of a Gaussian toward OP_vec, while storing the maximum values of each dimension to dimthres. for future pruning. The pruning itself is not performed here. This function will be used to compute the first N Gaussians.
binfo | [in] Gaussian density |
Definition at line 158 of file gprune_beam.c.
Referenced by gprune_beam().
static LOGPROB compute_g_beam_pruning | ( | HTK_HMM_Dens * | binfo | ) | [static] |
Calculate probability with pruning.
Calculate probability of a Gaussian toward OP_vec, performing pruning using the dimension thresholds that has been set by compute_g_beam_updating() and set_dimthres().
binfo | [in] Gaussian density |
Definition at line 194 of file gprune_beam.c.
Referenced by gprune_beam().
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().