libTLK  1.3.1
Data Structures | Defines | Enumerations | Functions
Acoustic model (HMMs)
Models

Data Structures

struct  tLAModelTransListEdge
 Transitions in type LIST. More...
struct  tLAModelTransListState
 Outgoing transitions for type LIST. More...
union  tLAModelTrans
 HMM transitions. More...
struct  tLAModelHMM
 HMM. More...
struct  tLAModel
 Acoustic model. More...

Defines

#define tL_amodel_get_fea_type(AMODEL)   (AMODEL)->meths->get_fea_type ( (AMODEL)->global )
 Gets the feature type.
#define tL_amodel_test(AMODEL, FEA, ERR)   (AMODEL)->meths->test ( (AMODEL)->global, (FEA), (ERR) )
 Tests sample compatibility.

Enumerations

enum  tLAModelTransType { , TLLINEAL, TLLIST, TLPOINTER }
 Type of HMM transitions. More...

Functions

 tL_amodel_copy (const tLAModel *amodel)
 Copies an acoustic model.
 tL_amodel_free (tLAModel *amodel)
 Frees memory.
 tL_amodel_mixture_new (const tLAModel *amodel)
 Creates a new set of mixture HMMs.
 tL_amodel_new_from_file (gzFile from, tLDict *syms, char **err)
 Reads an acoustic model from a file.
 tL_amodel_print (const tLAModel *amodel, FILE *to, const tLDict *syms, const tLBool binary)
 Prints the acoustic model.
 tL_amodel_smooth (tLAModel *amodel, const tLFloat f, const tLBool smooth_trans)
 Smooth parameters of acoustic model.
 tL_amodel_tiedstates_get_names (const tLAModel *amodel)
 Returns the names of the tied states.
 tL_amodel_tiedstates_mixture_new (const tLAModel *amodel)
 Creates a new set of tiedstates mixture HMM models.
 tL_amodel_bernoulli_new (const tLDict *syms, const unsigned int Q, const unsigned int D)
 Creates a new set of Bernoulli HMMs.
 tL_amodel_bernoulli_new_vs (const tLDict *syms, const unsigned int *Qs, const unsigned int D)
 Creates a new set of Bernoulli HMMs with variable states.
 tL_amodel_dgaussian_new (const tLDict *syms, const unsigned int Q, const unsigned int D)
 Creates a new set of diagonal Gaussian HMMs.
 tL_amodel_dgaussian_new_vs (const tLDict *syms, const unsigned int *Qs, const unsigned int D)
 Creates a new set of diagonal Gaussian HMMs with variable states.
 tL_amodel_dgaussian_get_smooth (tLAModel *amodel)
 Gets a pointer to the smooth array.

Define Documentation

#define tL_amodel_get_fea_type (   AMODEL)    (AMODEL)->meths->get_fea_type ( (AMODEL)->global )

Gets the feature type.

This macro returns the type of the feature vectors supported by the given acoustic model.

Parameters:
AMODELThe acoustic model.
Returns:
The type of the supported feature vectors.
#define tL_amodel_test (   AMODEL,
  FEA,
  ERR 
)    (AMODEL)->meths->test ( (AMODEL)->global, (FEA), (ERR) )

Tests sample compatibility.

This macro tests if the given feature vector sequence is compatible with the provided acoustic model.

Parameters:
AMODELThe acoustic model.
FEAA feature vector manager, which must contain a sequence of feature vectors of an adequate type for the AMODEL.
ERRPointer to string variable. If not NULL an error message is allocated in the variable in case of error.
Returns:
TRUE if the sample is compatible, FALSE otherwise.

Enumeration Type Documentation

Type of HMM transitions.

Enumerator:
TLLINEAL 

Lineal topology.

Only transitions to the next state and current state are allowed.

TLLIST 

Open topology.

Transitions for each state are stored as a list.

TLPOINTER 

Reference to previous HMM.

The transition matrix of the referenced HMM is used.


Function Documentation

tL_amodel_bernoulli_new ( const tLDict syms,
const unsigned int  Q,
const unsigned int  D 
)

Creates a new set of Bernoulli HMMs.

This functions creates a new set of Bernoulli HMMs. For each symbol of the provided dictionary, a new Bernoulli HMM with Q states and D-dimensional feature vectors is created.

Parameters:
symsNon-empty dictionary in which HMM labels are registered.
QThe number of states for the new Bernoulli HMM.
DThe dimension of feature vector for the new Bernoulli HMMs.
Returns:
The Bernoulli HMMs.
tL_amodel_bernoulli_new_vs ( const tLDict syms,
const unsigned int *  Qs,
const unsigned int  D 
)

Creates a new set of Bernoulli HMMs with variable states.

This functions creates a new set of Bernoulli HMMs. For each symbol of the provided dictionary, a new Bernoulli HMM with D-dimensional feature vector is created. An array of size syms->N is provided in order to indicate the number of states for each HMM.

Parameters:
symsNon-empty dictionary in which HMM labels are registered.
QsAn array with the number of states for each label of the dictionary.
DThe dimension of feature vector for the new Bernoulli HMMs.
Returns:
The Bernoulli HMMs.
tL_amodel_copy ( const tLAModel amodel)

Copies an acoustic model.

This function create a new copy of the provided acoustic model.

Parameters:
amodelThe acoustic model to copy.
Returns:
The acoustic model copy.

Gets a pointer to the smooth array.

This function gets a pointer to the smooth array of a diagonal Gaussian HMMs. The content of the array can be modified, but the pointer cannot be freed.

Parameters:
amodelThe diagonal Gaussian HMMs.
tL_amodel_dgaussian_new ( const tLDict syms,
const unsigned int  Q,
const unsigned int  D 
)

Creates a new set of diagonal Gaussian HMMs.

This functions creates a new set of diagonal Gaussian HMMs. For each symbol of the provided dictionary, a new diagonal Gaussian HMM with Q states and D-dimensional feature vectors is created.

Parameters:
symsNon-empty dictionary in which HMM labels are registered.
QThe number of states for the new diagonal Gaussian HMMs.
DThe dimension of feature vector for the new diagonal Gaussian HMMs.
Returns:
The diagonal Gaussian HMMs.
tL_amodel_dgaussian_new_vs ( const tLDict syms,
const unsigned int *  Qs,
const unsigned int  D 
)

Creates a new set of diagonal Gaussian HMMs with variable states.

This functions creates a new set of diagonal Gaussian HMMs. For each symbol of the provided dictionary, a new diagonal Gaussian HMM with D-dimensional feature vector is created. An array of size syms->N is provided in order to indicate the number of states for each HMM.

Parameters:
symsNon-empty dictionary in which HMM labels are registered.
QsAn array with the number of states for each label of the dictionary.
DThe dimension of feature vector for the new diagonal Gaussian HMMs.
Returns:
The diagonal Gaussian HMMs.
tL_amodel_free ( tLAModel amodel)

Frees memory.

Frees the memory allocated for the acoustic model.

Parameters:
amodelThe acoustic model.
tL_amodel_mixture_new ( const tLAModel amodel)

Creates a new set of mixture HMMs.

This function creates a new equivalent mixture version of the set of HMMs in the provided acoustic model. That is, each probability emission function T is replaced by a one component T mixture probability function.

Parameters:
amodelThe acoustic model.
Returns:
A new equivalent mixture version of the provided HMMs.
tL_amodel_new_from_file ( gzFile  from,
tLDict syms,
char **  err 
)

Reads an acoustic model from a file.

This functions creates a new acoustic model from a text description or binary representation. The symbols (phonems) related to the HMMs are registered into the given dictionary, which must be initially empty.

Parameters:
fromFile where the text description or binary representation is stored.
symsEmpty dictionary in which symbols (phonems) are registered.
errPointer to string variable. If not NULL an error message is allocated in the variable in case of error.
Returns:
The acoustic model, or NULL in case of error.
tL_amodel_print ( const tLAModel amodel,
FILE *  to,
const tLDict syms,
const tLBool  binary 
)

Prints the acoustic model.

This function writes in the given file the content of the acoustic model. Each HMM is labeled according to the provided dictionary. If binary is FALSE the content is written in text format, else it is written in binary format. The binary format is not a compact nor portable representation, but a way to ensure that parameters are written as they are stored in memory.

Parameters:
amodelThe acoustic models.
toFile where the models are written.
symsA dictionary with the labels of the HMMs.
binaryIf false the models are written in text format, else in binary format.
tL_amodel_smooth ( tLAModel amodel,
const tLFloat  f,
const tLBool  smooth_trans 
)

Smooth parameters of acoustic model.

This function is a common interface to smooth the parameters of HMMs regardless of the emission probability functions type. Diagonal Gaussian distributions are not affected by this function, instead they are smoothed using the SMOOTH values in the model description during parameter updating, the variances are floored to the SMOOTH values. Probability parameters are linearly interpolated with the uniform distribution using F.

Parameters:
amodelThe acoustic model.
fWeight used to perform a lineal interpolation with the uniform distribution (p*(1-f) + 0.5*f).
smooth_transIf TRUE the transition probabilities are smoothed.

Returns the names of the tied states.

This function returns the dictionary containing the names of the tied states.

Parameters:
amodelThe acoustic model.
Returns:
The dictionary containing the names, or NULL if HMM models are not of type TiedStates.

Creates a new set of tiedstates mixture HMM models.

Given a TiedStates HMM model set, this function create an equivalent tiedstate version in which each probability emission T is replaced by a one component T mixture probability function.

Parameters:
amodelThe TiedStates HMM models.
Returns:
A new equivalent mixture version of the provided TiedStates HMM models.
 All Data Structures Variables