segModel.c File Reference

Library of functions to load model parameters of segmental HMMs. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include "segCommon.h"
#include "segStdLib.h"
#include "segModel.h"

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

Library of functions to load model parameters of segmental HMMs.

Date:
28.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