libsent/src/phmm/gprune_beam.c File Reference

Calculate probability of a set of Gaussian densities by Gaussian pruning: beam algorithm. More...

#include <sent/stddefs.h>
#include <sent/htk_hmm.h>
#include <sent/htk_param.h>
#include <sent/hmm.h>
#include <sent/hmm_calc.h>

Go to the source code of this file.

Functions

static void clear_dimthres (HMMWork *wrk)
 Clear per-dimension thresholds.
static void set_dimthres (HMMWork *wrk)
 Set beam thresholds by adding TMBEAMWIDTH to the maximum values of each dimension.
static LOGPROB compute_g_beam_updating (HMMWork *wrk, HTK_HMM_Dens *binfo)
 Calculate probability with threshold update.
static LOGPROB compute_g_beam_pruning (HMMWork *wrk, HTK_HMM_Dens *binfo)
 Calculate probability with 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)
 Compute a set of Gaussians with beam pruning.


Detailed Description

Calculate probability of a set of Gaussian densities by Gaussian pruning: beam algorithm.

gprune_beam() is one of the functions to compute output probability of a set of Gaussian densities. This function does beam pruning, trying to compute only the best ones for faster computation. If a tied-mixture HMM model with GPRUNE_DEFAULT_BEAM defined in Julius, or explicitly specified by "-gprune beam" option, this function will be used.

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

Author:
Akinobu LEE
Date:
Thu Feb 17 03:27:53 2005
Revision
1.1.1.1

Definition in file gprune_beam.c.


Function Documentation

static void clear_dimthres ( HMMWork wrk  )  [static]

Clear per-dimension thresholds.

Parameters:
wrk [i/o] HMM computation work area

Definition at line 125 of file gprune_beam.c.

Referenced by gprune_beam().

static void set_dimthres ( HMMWork wrk  )  [static]

Set beam thresholds by adding TMBEAMWIDTH to the maximum values of each dimension.

Parameters:
wrk [i/o] HMM computation work area

Definition at line 139 of file gprune_beam.c.

Referenced by gprune_beam().

static LOGPROB compute_g_beam_updating ( HMMWork wrk,
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.

Parameters:
wrk [i/o] HMM computation work area
binfo [in] Gaussian density
Returns:
the output log probability.

Definition at line 159 of file gprune_beam.c.

Referenced by gprune_beam().

static LOGPROB compute_g_beam_pruning ( HMMWork wrk,
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().

Parameters:
wrk [i/o] HMM computation work area
binfo [in] Gaussian density
Returns:
the output log probability.

Definition at line 199 of file gprune_beam.c.

Referenced by gprune_beam().

boolean gprune_beam_init ( HMMWork wrk  ) 

Initialize and setup work area for Gaussian pruning by beam algorithm.

Parameters:
wrk [i/o] HMM computation work area
Returns:
TRUE on success, FALSE on failure.

Definition at line 234 of file gprune_beam.c.

Referenced by outprob_init().

void gprune_beam_free ( HMMWork wrk  ) 

Free gprune_beam related work area.

Parameters:
wrk [i/o] HMM computation work area

Definition at line 256 of file gprune_beam.c.

Referenced by outprob_init().

void gprune_beam ( HMMWork wrk,
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().

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

Definition at line 289 of file gprune_beam.c.

Referenced by outprob_init().


Generated on Tue Dec 18 16:01:40 2007 for Julius by  doxygen 1.5.4