segModel.h File Reference

Header file for functions to load model parameters of segmental HMMs. More...

Go to the source code of this file.

Data Structures

struct  segTrajectoryParam
 Parameters for the segmental model. More...
struct  segDurationParam
 Parameters for the duration model. More...
struct  segMappingParam
 Assigned for each state. More...
struct  segStateInfo
 Assigned for each state. More...
struct  segTransProb
 Transition probabilities. More...
struct  segModelParam
 Model parameters. More...
struct  segModel
 Model definition (label + parameter struct pointer). More...
struct  segModelSet
 Entire set for memory allocation. More...

Defines

#define segGetTVal(t, s, e)   ((double)(t)-0.5*(double)((e)-(s)))

Typedefs

typedef segTrajectoryParam SEG_TRJ
 Parameters for the segmental model.
typedef segDurationParam SEG_DUR
 Parameters for the duration model.
typedef segMappingParam SEG_MAP
 Assigned for each state.
typedef segStateInfo SEG_STATE
 Assigned for each state.
typedef segTransProb SEG_TRPROB
 Transition probabilities.
typedef segModelParam SEG_MDPARAM
 Model parameters.
typedef segModel SEG_MODEL
 Model definition (label + parameter struct pointer).
typedef segModelSet SEG_MODEL_SET
 Entire set for memory allocation.

Functions

int segMakeStrictLRTopology (SEG_MODEL_SET *modelSet)
 Force models to maintain strict left-to-right topology.
int segCheckModelSet (SEG_MODEL_SET *modelSet)
 Check the consistency of model parameter set.
SEG_MODEL_SETsegReadModelSet (char *modelList, char *tiedList, int maxDur)
 Read a set of multi-level segmental-HMMs in the file of model name list.
int segWriteModelSet (SEG_MODEL_SET *modelSet, FILE *fp)
 Write a set of models to a file.
int segWriteDump (SEG_MODEL_SET *modelSet, char *fName)
 Write dump file contents.


Detailed Description

Header file for functions to load model parameters of segmental HMMs.

Date:
30.06.2007
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This code is written based on M Russell and P Jackson's SEGVit ver.3.4, although completely different from the original code. Context-sensitive (triphone) models are now introduced.
Revision

Function Documentation

int segCheckModelSet ( SEG_MODEL_SET modelset  ) 

Check the consistency of model parameter set.

This function checks if a given model parameter set is consistent in terms of the dimensionality of vectors and matrices.

Parameters:
[in] modelset Pointer to the model-set structure variable
Return values:
NO_ERROR Successful execution
RTN_ERROR Inconsistency found in the set
Author:
Yoshinori Shiga @ CVSSP, University of Surrey

int segMakeStrictLRTopology ( SEG_MODEL_SET modelset  ) 

Force models to maintain strict left-to-right topology.

Parameters:
[in,out] modelset Pointer to the model-set structure variable
Return values:
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function scans all the transition probability matrices in the model set for any self loops. If present, it replaces their probabilities with zero.

SEG_MODEL_SET* segReadModelSet ( char *  modelList,
char *  tiedList,
int  maxDur 
)

Read a set of multi-level segmental-HMMs in the file of model name list.

Parameters:
[in] modelList Name of file containing model file name list
[in] tiedList Name of file containing tied-phone list
[in] maxDur Maximal segment-duration
Return values:
NULL Memory allocation/File read error
otherwise Pointer to a read model set
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
If the pointer "tiedList" is NULL, logical models are so built as to be identical to physical models.
Users can set new maximal segment-duration (maxDur) different from ones specified per state in the model file. If a negative value is set to maxDur, the maximal segment-durations for each state in the model are applied.
This function internally calls readModelSet(), tieModelParameters(), buildLogicalModels() and segCheckModelSet().
See also:
readModelSet(), tieModelParameters(), buildLogicalModels() and segCheckModelSet().

int segWriteDump ( SEG_MODEL_SET modelset,
char *  fName 
)

Write dump file contents.

This function creates a dump file, which includes the label name, maximum segment-duration, the number of states, and duration count and skip count results, for debugging purpose.

Parameters:
[in] modelset Pointer to the model-set structure variable
[in] fName Name of dump file
Return values:
RTN_ERROR File open error
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey

int segWriteModelSet ( SEG_MODEL_SET modelset,
FILE *  fp 
)

Write a set of models to a file.

Parameters:
[in] modelset Pointer to the model-set structure variable
[in] fp File pointer
Return values:
RTN_ERROR Memory allocation error / File write error
NO_ERROR Successful execution
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function outputs the current model set to the user-specified directory.
The following functions are called internally: writeMatrix(), writeVector() and writeStateInfo().
See also:
writeMatrix(), writeVector() and writeStateInfo()


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