SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Enumerations | Functions
rm_gauss.c File Reference

Quick selection of gaussians for SC_HMMs. More...

Enumerations

enum  {
  SPR_FROG_BMP, SPR_FROG_16, SPR_FROG_32, SPR_FROG_COMPACT,
  SPR_FROG_FAST_MVG, SPR_FROG_GS, SPR_FROG_NO_GS
}
 Different flags for the FRoG-system. More...
 

Functions

void spr_frog_sel_bmp_compress (SprHmmUchar4 *restrict sel, int nmvgs)
 
void spr_frog_sel_bmp_uncompress (SprHmmUchar4 *restrict sel, int nmvgs)
 
SprHmmRmgInfospr_frog_rmg_free (SprHmmRmgInfo *info)
 Deallocates all memory allocated to the rmg_info. More...
 
int spr_frog_rmg_sel_sum (const SprHmmRmgInfo *info, const SprHmmUchar4 *sel)
 Count the number of ones in the selection array. More...
 
SprHmmRmgInfospr_frog_rmg_change (SprHmmRmgInfo *info, double margin, double sigma)
 
SprHmmUcharspr_frog_rmg_select_ (const SprHmmRmgInfo *info, const float *x, const SprHmmUchar *sel_in, SprHmmUchar *restrict sel_out)
 
void spr_frog_rmg_multi_select (SprHmmMvgs *const *mvgs, int nmix, const float *dptr)
 
int spr_frog_rmg_stats_alloc (SprHmmRmgInfo *info)
 
int spr_frog_rmg_stats_read (SprHmmRmgInfo *info, char *fname)
 
int spr_frog_rmg_stats_write (char *fname, SprHmmRmgInfo *info)
 Dump the rmg stats to disk. More...
 
SprHmmUchar4spr_frog_rmg_stats_select (SprHmmRmgInfo *info, float *x, SprHmmUchar4 *sel_out)
 
int spr_frog_rmg_stats_cnt (const SprHmmRmgInfo *info, int trunc_val, float *max_red_loss, float *est_red_loss)
 
SprHmmRmgInfospr_frog_rmg_stats_reduce (SprHmmRmgInfo *info, int trunc_val)
 
int spr_frog_rmg_write (const char *rmg_fname, SprAcmod *gset, SprHmmMvgs **mvgs, int nmix)
 
SprHmmRmgInfospr_frog_rmg_bmp_compress (SprHmmRmgInfo *info, int effort)
 
SprHmmRmgInfospr_frog_rmg_init (SprAcmod *gset, SprHmmMvgs *mvgs, int imix, const char *rmg_flags)
 Initialise the rmg_info. More...
 
void spr_frog_rmgs_init (SprHmmMvgs **mvgs, int nmix, const char *rmg_flags)
 
void spr_frog_rmg_reduc (SprHmmRmgInfo *info, const SprHmmUchar *sel)
 

Detailed Description

Quick selection of gaussians for SC_HMMs.

Removes gaussian's in the select list (byte array with a flag for each gaussian, a gaussian is evaluated if its corresponding flag is set). The removal rate is controled with two parameters: <log2_nr_div> and <margin> Each axis is divided in 2^<log2_nr_div> divisions. The initialisation routine determines for each gaussian and for each cel whether the gaussian has to be evaluated or not. The special storage of the information (a binary tree) results in a very fast removal algorithm.

To determine whether a gaussian has to be evaluate or not, two approaches are uses:

  1. A gaussian is not evaluated for a specific cel, if its probability for that part of the axis is lower than <margin> times the average probability.
  2. Only evaluate the gaussian if the point lay within a certain range based on the mean and the variance: [mu-f*sigma,mu+f*sigma].

Following can be specified to control the FRoG system:

no
Don't use the FRoG system.
compact
Do some extra compression (up to 50%) of the FRoG-info, at the cost of a slower evaluation (e.g. 30%).
bmp=<lvl>
Do bitmap compression of the FRoG information with a certain optimization level. A substantial amount of computation time is needed for any non zero optimization level. The memory requirements are comparable to that of the compact option (somewhat larger for <lvl>=0, and somewhat smaller otherwise). This compression makes the evaluation faster, especially when a non zero optimization level is specified.
new
Use the gaussian counts and an improved estimation of the reduction factor.
f:<file>
Load precompiled FRoG information from the given <file>.
n<nr>
Specify the number of subdivisions per axis. The given number is the log2() of the number of subdivisions.
m<value>
Specify the margin for the 1st approach.
s<value>
Specify the range (times sigma) for the 2nd approach.
r<value>
Specify a requested reduction factor. The 'm' and 's' options can be used to specify start values. By default, only the 1st approach is used, with a start margin of 0.01.
[RMG_flags]
no(NULL)
Don't use the FRoG system.
compact(NULL)
Do some extra compression (up to 50%) of the FRoG-info, at the cost of a slower evaluation (e.g. 30%).
new(NULL)
Use the gaussian counts and an improved estimation of the reduction factor.
f:<String:val>(NULL)
Load precompiled FRoG information from the given <file>.
n<I32:val>(9)
Specify the number of subdivisions per axis. The given number is the log2() of the number of subdivisions.
m<F32:val>(-1)
Specify the margin for the 1st approach.
r<F32:val>(-1)
Specify a requested reduction factor. The 'm' and 's' options can be used to specify start values. By default, only the 1st approach is used, with a start margin of 0.01.
s<F32:val>(-1)
Specify the range (times sigma) for the 2nd approach.
bmp=<I32:val>(-1)
Do bitmap compression of the FRoG information with a certain optimization level. A substantial amount of computation time is needed for any non zero optimization level. The memory requirements are comparable to that of the compact option (somewhat larger for <lvl>=0, and somewhat smaller otherwise). This compression makes the evaluation faster, especially when a non zero optimization level is specified.
bmp
Do bitmap compression using the default optimzation level.
<F32:val>
Specify the target reduction factor (identical to r<nr>).
Author
Kris Demuynck
Date
October 21st 1994
Revision History:
09/95 - KD
added change_rmg
10/95 - JD
Modifications for new hmm structures
01/97 - KD
added write_rmg and read_rmg
08/97 - KD
added the compact-FRoG functionality
10/97 - KD
added the 2nd approach (sigma based)
02/99 - KD
addapted for fast_mvg()
03/99 - KD
added extra statistics for FRoG-redundancy removal
08/04 - KD
fully transparent 16/32 bits mode + optimizations
Bug:

All gaussians may be removed (indicating a very odd observation).

The method does not combine information over the different axes, so an odd value in one direction will remove the gaussian, despite perfect matches in all other directions.

The average probability is detemined based on the gaussians solely, requiring good estimated gaussians (enough traindata and a decent training).