Julius 4.2
マクロ定義 | 関数
libsent/src/phmm/gprune_beam.c

混合ガウス分布計算: Gaussian pruning (beam algorithm) [詳細]

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

ソースコードを見る。

関数

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, int lnum)
 Compute a set of Gaussians with beam pruning.

説明

混合ガウス分布計算: Gaussian pruning (beam algorithm)

gprune_beam()は混合ガウス分布集合の計算ルーチンの一つです. beam pruning を使って上位のガウス分布の出力確率のみを高速に求めます. Tied-mixture HMM 使用時に Julius でGPRUNE_DEFAULT_BEAM が定義されているか, あるいはJuliusのオプション "-gprune beam" を指定することでこの関数が 使用されます.

beam pruning は最も積極的に枝刈りを行ないます.計算は最も高速ですが, 上位のガウス分布が正しく得られず出力確率の誤りが大きくなる可能性があります.

gprune_beam()outprob_init() によってその関数へのポインタが compute_gaussset にセットされることで使用されます.このポインタが calc_tied_mix() または calc_mix() から呼び出されます.

作者:
Akinobu LEE
日付:
Thu Feb 17 03:27:53 2005
Revision:
1.5

gprune_beam.c で定義されています。


関数

static void clear_dimthres ( HMMWork wrk) [static]

Clear per-dimension thresholds.

引数:
wrk[i/o] HMM computation work area

gprune_beam.c125 行で定義されています。

参照元 gprune_beam().

static void set_dimthres ( HMMWork wrk) [static]

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

引数:
wrk[i/o] HMM computation work area

gprune_beam.c139 行で定義されています。

参照元 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.

引数:
wrk[i/o] HMM computation work area
binfo[in] Gaussian density
戻り値:
the output log probability.

gprune_beam.c159 行で定義されています。

参照元 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().

引数:
wrk[i/o] HMM computation work area
binfo[in] Gaussian density
戻り値:
the output log probability.

gprune_beam.c199 行で定義されています。

参照元 gprune_beam().

boolean gprune_beam_init ( HMMWork wrk)

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

引数:
wrk[i/o] HMM computation work area
戻り値:
TRUE on success, FALSE on failure.

gprune_beam.c234 行で定義されています。

参照元 outprob_init().

void gprune_beam_free ( HMMWork wrk)

Free gprune_beam related work area.

引数:
wrk[i/o] HMM computation work area

gprune_beam.c257 行で定義されています。

参照元 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.c291 行で定義されています。

参照元 outprob_init().