(Sphinx 3.0 specific) Gaussian density module. More...
Go to the source code of this file.
Classes | |
struct | gauden_t |
Multivariate gaussian mixture density parameters. More... | |
struct | gauden_dist_t |
Structure to store distance (density) values for a given input observation wrt density values in some given codebook. More... | |
Functions | |
gauden_t * | gauden_init (const char *meanfile, const char *varfile, float32 varfloor, int32 precompute, logmath_t *logmath) |
void | gauden_free (gauden_t *g) |
int32 | gauden_mean_reload (gauden_t *g, const char *meanfile) |
int32 | gauden_dist (gauden_t *g, s3mgauid_t mgau, int32 n_top, vector_t *obs, gauden_dist_t **out_dist) |
int32 | gauden_dist_norm (gauden_t *g, int32 n_top, gauden_dist_t ***dist, uint8 *active) |
void | gauden_dump (const gauden_t *g) |
void | gauden_dump_ind (const gauden_t *g, int senidx) |
(Sphinx 3.0 specific) Gaussian density module.
Gaussian density distribution implementation. There are two major difference bettwen ms_gauden and cont_mgau. One is the fact that ms_gauden only take cares of the Gaussian computation part where cont_mgau actually take care of senone computation as well. The other is the fact that ms_gauden is a multi-stream implementation of GMM computation.
int32 gauden_dist | ( | gauden_t * | g, |
s3mgauid_t | mgau, | ||
int32 | n_top, | ||
vector_t * | obs, | ||
gauden_dist_t ** | out_dist | ||
) |
Compute gaussian density values for the given input observation vector wrt the specified mixture gaussian codebook (which may consist of several feature streams). Density values are left UNnormalized.
g | In: handle to entire ensemble of codebooks |
mgau | In: codebook for which density values to be evaluated (g->{mean,var}[mgau]) |
n_top | In: #top densities to be evaluated |
obs | In: Observation vector; obs[f] = for feature f |
out_dist | Out: n_top best codewords and density values, in worsening order, for each feature stream. out_dist[f][i] = i-th best density for feature f. Caller must allocate memory for this output |
int32 gauden_dist_norm | ( | gauden_t * | g, |
int32 | n_top, | ||
gauden_dist_t *** | dist, | ||
uint8 * | active | ||
) |
Normalize density values (previously computed by gauden_dist). Two cases: If (g->n_mgau == 1), normalize such that the sum of the n_top codeword scores for each feature in dist sums to 1 (in prob domain). Otherwise, normalize by dividing the density value (subtracting, in logprob domain) for each codeword by the best one.
g | In: handle to all collection of codebooks |
n_top | In: #density values computed per feature |
dist | In/Out: n_top density indices and values for each feature. On return, density values are normalized. |
active | In: active[gid] is non-0 iff codebook gid is active. If NULL, all codebooks active |
void gauden_dump | ( | const gauden_t * | g | ) |
Dump the definitionn of Gaussian distribution.
g | In: Gaussian distribution g |
void gauden_dump_ind | ( | const gauden_t * | g, |
int | senidx | ||
) |
Dump the definition of Gaussian distribution of a particular index to the standard output stream
g | In: Gaussian distribution g |
senidx | In: The senone index of the Gaussian |
void gauden_free | ( | gauden_t * | g | ) |
Release memory allocated by gauden_init. In: The gauden_t to free
gauden_t* gauden_init | ( | const char * | meanfile, |
const char * | varfile, | ||
float32 | varfloor, | ||
int32 | precompute, | ||
logmath_t * | logmath | ||
) |
Read mixture gaussian codebooks from the given files. Allocate memory space needed for them. Apply the specified variance floor value. Return value: ptr to the model created; NULL if error. (See Sphinx3 model file-format documentation.)
meanfile | Input: File containing means of mixture gaussians |
varfile | Input: File containing variances of mixture gaussians |
varfloor | Input: Floor value to be applied to variances |
precompute | Input: Whether we should precompute |
int32 gauden_mean_reload | ( | gauden_t * | g, |
const char * | meanfile | ||
) |
Reload mixture Gaussian means from the given file. The means must have already been loaded at least once (using gauden_init).
g | In/Out: g->mean to be reloaded |
meanfile | In: File to reload means from |