libTLK
1.3.1
|
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 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.
AMODEL | The acoustic model. |
#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.
AMODEL | The acoustic model. |
FEA | A feature vector manager, which must contain a sequence of feature vectors of an adequate type for the AMODEL. |
ERR | Pointer to string variable. If not NULL an error message is allocated in the variable in case of error. |
enum tLAModelTransType |
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.
syms | Non-empty dictionary in which HMM labels are registered. |
Q | The number of states for the new Bernoulli HMM. |
D | The dimension of feature vector for the new 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.
syms | Non-empty dictionary in which HMM labels are registered. |
Qs | An array with the number of states for each label of the dictionary. |
D | The dimension of feature vector for the new Bernoulli HMMs. |
tL_amodel_copy | ( | const tLAModel * | amodel | ) |
Copies an acoustic model.
This function create a new copy of the provided acoustic model.
amodel | The acoustic model to copy. |
tL_amodel_dgaussian_get_smooth | ( | tLAModel * | amodel | ) |
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.
amodel | The 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.
syms | Non-empty dictionary in which HMM labels are registered. |
Q | The number of states for the new diagonal Gaussian HMMs. |
D | The dimension of feature vector for the new 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.
syms | Non-empty dictionary in which HMM labels are registered. |
Qs | An array with the number of states for each label of the dictionary. |
D | The dimension of feature vector for the new diagonal Gaussian HMMs. |
tL_amodel_free | ( | tLAModel * | amodel | ) |
Frees memory.
Frees the memory allocated for the acoustic model.
amodel | The 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.
amodel | The acoustic model. |
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.
from | File where the text description or binary representation is stored. |
syms | Empty dictionary in which symbols (phonems) are registered. |
err | Pointer to string variable. If not NULL an error message is allocated in the variable 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.
amodel | The acoustic models. |
to | File where the models are written. |
syms | A dictionary with the labels of the HMMs. |
binary | If 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.
amodel | The acoustic model. |
f | Weight used to perform a lineal interpolation with the uniform distribution (p*(1-f) + 0.5*f). |
smooth_trans | If TRUE the transition probabilities are smoothed. |
tL_amodel_tiedstates_get_names | ( | const tLAModel * | amodel | ) |
Returns the names of the tied states.
This function returns the dictionary containing the names of the tied states.
amodel | The acoustic model. |
tL_amodel_tiedstates_mixture_new | ( | const tLAModel * | amodel | ) |
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.
amodel | The TiedStates HMM models. |