segReest.c File Reference

Reestimation for uniform trajectory segmental HMMs. More...

#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

static void initTransProbs (SEG_TRPROB *transProb)
 Initialise accumulators for transition probabilities.
static void initTrjModels (SEG_TRJ *trjModel)
 Initialise accumulators for trajectory model parameters.
static void initDurModels (SEG_DUR *durModel)
 Initialise accumulators for duration model parameters.
static void initStates (SEG_STATE *stateInfo)
 Initialise accumulators for state model parameters.
static void reestTransProbs (SEG_TRPROB *transProb)
 Reestimate transition probabilities for a model.
static void reestTrjModels (SEG_TRJ *trjModel, double minVar, double slopeRate, double varRate)
 Reestimate trajectory model parameters for a model.
static int reestGammaDistDurModels (SEG_DUR *durModel, double durRegParam)
 Reestimate the gamma distribution of the duration model.
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.
static int modelOccupancy (SEG_TRPROB *transProb)
 Count model occupancy on accumulators for transition probabilities.
static int durModelOccupancy (SEG_DUR *durModel)
 Count duration model occupancy on accumulators for duration modelling.
int segReestSegModels (SEG_MODEL_SET *hmmSet, SEG_CONFIG *config)
 Reestimate linear segmental-HMM parameters.


Detailed Description

Reestimation for uniform trajectory segmental HMMs.

Date:
12.05.2006
05.07.2007 (documented)
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This code was originally created on the basis of Martin Russell & P Jackson's SEGVit Ver.3.4.
Revision

Function Documentation

static int durModelOccupancy ( SEG_DUR durModel  )  [static]

Count duration model occupancy on accumulators for duration modelling.

Parameters:
[in] durModel Pointer to a struct variable of the duration model
Returns:
The occupancy of the duration model

static void initDurModels ( SEG_DUR durModel  )  [static]

Initialise accumulators for duration model parameters.

Parameters:
[in] durModel Pointer to a structure variable of the parameters
Returns:
No return value

static void initStates ( SEG_STATE stateInfo  )  [static]

Initialise accumulators for state model parameters.

Parameters:
[in] stateInfo Pointer to a structure variable of the parameters
Returns:
No return value
Note:
Functions initTrjModels() and initDurModels() are called internally.
See also:
initTrjModels() and initDurModels()

static void initTransProbs ( SEG_TRPROB transProb  )  [static]

Initialise accumulators for transition probabilities.

Parameters:
[in] transProb Pointer to a transition probability structure variable
Returns:
No return value

static void initTrjModels ( SEG_TRJ trjModel  )  [static]

Initialise accumulators for trajectory model parameters.

Parameters:
[in] trjModel Pointer to a structure variable of the parameters
Returns:
No return value

static int modelOccupancy ( SEG_TRPROB transProb  )  [static]

Count model occupancy on accumulators for transition probabilities.

Parameters:
[in] transProb Pointer to a struct variable of transition probabilities
Returns:
The occupancy of the model

static int reestGammaDistDurModels ( SEG_DUR durModel,
double  durRegParam 
) [static]

Reestimate the gamma distribution of the duration model.

Parameters:
[in,out] durModel Pointer to a struct variable of the model
[in] durRegParam Regularization parameter for duration training
Return values:
NO_ERROR Successful execution
RTN_ERROR No occupancy for the duration model
Note:
Function logProb() is called internally.
See also:
logProb()

static void reestTransProbs ( SEG_TRPROB transProb  )  [static]

Reestimate transition probabilities for a model.

Parameters:
[in,out] transProb Pointer to a struct variable of the probabilities
Returns:
No return value
Note:
Function logProb() is called internally.
See also:
logProb()

static void reestTrjModels ( SEG_TRJ trjModel,
double  minVar,
double  slopeRate,
double  varRate 
) [static]

Reestimate trajectory model parameters for a model.

Parameters:
[in,out] trjModel Pointer to a structure variable of the parameter
[in] minVar Floor for the variance of trajectory model
[in] slopeRate Rate for updating the slope
[in] varRate Rate for updating the variance
Returns:
No return value

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

Parameters:
[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
Return values:
RTN_ERROR Memory allocation error
NO_ERROR Successfully executed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
The accumulation is carried out based on the optimal state sequence from training.

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.

Parameters:
[in,out] hmmSet Model set
Returns:
NO_ERROR Successfully executed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
The following functions are called internally: initTransProbs(), initStates(), initTrjModels() and initDurModels().
See also:
initTransProbs(), initStates(), initTrjModels() and initDurModels().

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.

Parameters:
[in,out] hmmSet Model set
[in] config Configuration parameters
Return values:
NO_ERROR Successfully executed
RTN_ERROR Too small number of samples for the model
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
The following functions are called internally: modelOccupancy(), reestTransProbs(), reestTrjModels(), durModelOccupancy(), and reestGammaDistDurModels() or reestDiscreteDurModels().
See also:
modelOccupancy(), reestTransProbs(), reestTrjModels(), durModelOccupancy(), reestGammaDistDurModels() and reestDiscreteDurModels()


Generated on Sun Aug 5 02:40:40 2007 for SEGRec Version 1.0 by  doxygen 1.5.1