#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "segCommon.h"
#include "segStdLib.h"
#include "segReest.h"
Defines | |
#define | GAMMA_DUR_MODEL |
Defining this means the gamma function is used to approximate the duration distribution. | |
#define | DUR_PROB_OFFSET 0.0 |
This is used to avoid the duration model outputting BIGNUMs. | |
#define | DUR_SD_FLOOR (1/sqrt(2)) |
Floor of variance for the duration model. | |
Functions | |
int | segIncrementLinearHMMAccumulators (SEG_STATE **stateId, int *stateSeq, SEG_SYNTAX *syn, double **spData, int sT, int eT, int maxDur) |
Increment the reestimation bins, according to the current utterance alignment. | |
int | segInitialiseHMMAccumulators (SEG_MODEL_SET *hmmSet) |
Initialise reestimation accumulators for the entire set of models. | |
int | segReestSegModels (SEG_MODEL_SET *hmmSet, SEG_CONFIG *config) |
Reestimate linear segmental-HMM parameters. |
int segIncrementLinearHMMAccumulators | ( | SEG_STATE ** | stateId, | |
int * | stateSeq, | |||
SEG_SYNTAX * | syn, | |||
double ** | spData, | |||
int | sT, | |||
int | eT, | |||
int | maxDur | |||
) |
Increment the reestimation bins, according to the current utterance alignment.
The function uses the optimal state sequence (i.e., the current utterance alignment) to add each acoustic vector to the accumulator of the corresponding HMM state on the optimal state sequence Linear trajectory model (i.e. slope and mean value).
[in,out] | stateId | Array of state IDs of the best state-sequence |
[in] | stateSeq | The best state sequence |
[in] | syn | Syntax |
[in] | spData | Acoustic feature vectors of speech data |
[in] | sT | Start time of the utterance |
[in] | eT | End time of the utterance |
[in] | maxDur | Maximum segment duration |
RTN_ERROR | Memory allocation error | |
NO_ERROR | Successfully executed |
int segInitialiseHMMAccumulators | ( | SEG_MODEL_SET * | hmmSet | ) |
Initialise reestimation accumulators for the entire set of models.
The function initialises reestimation accumulators for the entire set of models.
[in,out] | hmmSet | Model set |
int segReestSegModels | ( | SEG_MODEL_SET * | hmmSet, | |
SEG_CONFIG * | config | |||
) |
Reestimate linear segmental-HMM parameters.
The function reestimates the segmental HMMs using the accumulated values in the reestimation bins.
[in,out] | hmmSet | Model set |
[in] | config | Configuration parameters |
NO_ERROR | Successfully executed | |
RTN_ERROR | Too small number of samples for the model |