libTLK  1.3.1
Defines | Typedefs | Functions
Acoustic model counts
Algorithms

Defines

#define tL_occupancies_free(occs)
 Frees occupancies.

Typedefs

typedef void tLAMiCounts
 Integer counts for tLAModel.
typedef void tLAMlogCounts
 Logarithmic counts for tLAModel.
typedef void tLMixCounts
 Mixture coefficient counts.

Functions

 tL_amicounts_accum (const tLAMiCounts *counts, const tLAModel *amodel, gzFile from, const tLBool binary, char **err)
 Accumulates the integer counts from file.
 tL_amicounts_free (tLAMiCounts *counts, const tLAModel *amodel)
 Frees memory.
 tL_amicounts_get_mixcounts (tLAMiCounts *counts, const tLAModel *amodel, char **err)
 Returns the counts of the mixture coefficients.
 tL_amicounts_init (tLAMiCounts *counts, const tLAModel *amodel)
 Initializes the integer counts to 0.
 tL_amicounts_init_hmm (tLAMiCounts *counts, const tLAModel *amodel, const unsigned int c)
 Initializes the integer counts of an HMM to 0.
 tL_amicounts_init_hmm_val (tLAMiCounts *counts, const tLAModel *amodel, const unsigned int c, const unsigned long val)
 Initializes the integer counts of an HMM.
 tL_amicounts_init_val (tLAMiCounts *counts, const tLAModel *amodel, const unsigned long val)
 Initializes the integer counts.
 tL_amicounts_new (const tLAModel *amodel)
 Creates a new AMiCounts.
 tL_amicounts_print (const tLAMiCounts *counts, const tLAModel *amodel, FILE *to, const tLBool binary)
 Prints the integer counts.
 tL_amicounts_read (const tLAMiCounts *counts, const tLAModel *amodel, gzFile from, const tLBool binary, char **err)
 Reads the integer counts from file.
 tL_amicounts_update_hmm (const tLAMiCounts *counts, tLAModel *amodel, const unsigned int c)
 Update parameters of an HMM.
 tL_amicounts_update_amodel (const tLAMiCounts *counts, tLAModel *amodel)
 Update parameters.
 tL_amlogcounts_accum (const tLAMlogCounts *counts, const tLAModel *amodel, gzFile from, const tLBool binary, char **err)
 Accumulates the logarithmic counts from file.
 tL_amlogcounts_accum_eps (const tLAMlogCounts *counts, const tLAModel *amodel, gzFile from, const tLFloat eps, const tLBool binary, char **err)
 Interpolates current logarithmic counts with the logarithmic counts from file.
 tL_amlogcounts_free (tLAMlogCounts *counts, const tLAModel *amodel)
 Frees memory.
 tL_amlogcounts_get_mixcounts (tLAMlogCounts *counts, const tLAModel *amodel, char **err)
 Returns the counts of the mixture coefficients.
 tL_amlogcounts_init (tLAMlogCounts *counts, const tLAModel *amodel)
 Initializes the logarithmic counts to -INF.
 tL_amlogcounts_init_hmm (tLAMiCounts *counts, const tLAModel *amodel, const unsigned int c)
 Initializes the logarithmic counts of an HMM to -INF.
 tL_amlogcounts_init_hmm_val (tLAMiCounts *counts, const tLAModel *amodel, const unsigned int c, const tLFloat val)
 Initializes the logarithmic counts of an HMM.
 tL_amlogcounts_init_val (tLAMlogCounts *counts, const tLAModel *amodel, const tLFloat val)
 Initializes the logarithmic counts.
 tL_amlogcounts_new (const tLAModel *amodel)
 Creates a new AMlogCounts.
 tL_amlogcounts_new_cmllr (const tLAModel *amodel)
 Creates a new AMlogCounts for CMLLR.
 tL_amlogcounts_new_mllr (const tLAModel *amodel)
 Creates a new AMlogCounts for MLLR.
 tL_amlogcounts_print (const tLAMlogCounts *counts, const tLAModel *amodel, FILE *to, const tLBool binary)
 Prints the logarithmic counts.
 tL_amlogcounts_read (const tLAMlogCounts *counts, const tLAModel *amodel, gzFile from, const tLBool binary, char **err)
 Reads the logarithmic counts from file.
 tL_amlogcounts_update_hmm (const tLAMlogCounts *counts, tLAModel *amodel, const unsigned int c)
 Update parameters of an HMM.
 tL_amlogcounts_update_amodel (const tLAMlogCounts *counts, tLAModel *amodel)
 Update parameters.
 tL_mixcounts_free (tLMixCounts *mcounts, const tLAModel *amodel)
 Frees mixture counts.
 tL_mixcounts_print (const tLMixCounts *mcounts, const tLAModel *amodel, const tLDict *syms, FILE *to)
 Prints mixture counts.
 tL_mixcounts_read (const tLAModel *amodel, gzFile from, char **err)
 Reads mixture counts from file.
 tL_occupancies_init (tLFloat **occs, const tLAModel *amodel)
 Inits the occupancy values.
 tL_occupancies_new (const tLAModel *amodel)
 Allocs memory to store the occupancies.
 tL_occupancies_print (tLFloat **occs, FILE *to, const tLAModel *amodel, const tLDict *syms)
 Prints the occupancy values.

Define Documentation

#define tL_occupancies_free (   occs)
Value:
do {                              \
    free ( (occs)[0] );           \
    free ( (occs) );              \
  } while(0)

Frees occupancies.

This macro frees the memory allocated for the occupancies matrix.

Parameters:
occsThe occupancy values.

Typedef Documentation

typedef void tLAMiCounts

Integer counts for tLAModel.

This opaque structure is used to store integer counts for a set of HMMs.

typedef void tLAMlogCounts

Logarithmic counts for tLAModel.

This opaque structure is used to store logarithmic counts for a set of HMMs.

typedef void tLMixCounts

Mixture coefficient counts.

This opaque structure is used to store the counts related to the mixture coefficients.


Function Documentation

tL_amicounts_accum ( const tLAMiCounts counts,
const tLAModel amodel,
gzFile  from,
const tLBool  binary,
char **  err 
)

Accumulates the integer counts from file.

This function reads the integer counts from the provided file, in text or binary format, and then it accumulates the read counts over the current counts. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe integer counts.
amodelThe acoustic model which was used to create the counts.
fromFile where the counts are stored.
binaryIf TRUE, stored counts are assumed to be in binary format; else, in text format.
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
Returns:
0 if counts have been successfully accumulated, -1 otherwise.
tL_amicounts_free ( tLAMiCounts counts,
const tLAModel amodel 
)

Frees memory.

Frees the memory allocated for the integer counts. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe integer counts to free.
amodelThe acoustic model which was used to create the counts.
tL_amicounts_get_mixcounts ( tLAMiCounts counts,
const tLAModel amodel,
char **  err 
)

Returns the counts of the mixture coefficients.

This function is only applicable to HMMs of type Mixture or TiedState Mixture.

Parameters:
countsThe integer counts.
amodelThe acoustic model.
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
Returns:
The mixture coefficient counts, or NULL in case of error.
tL_amicounts_init ( tLAMiCounts counts,
const tLAModel amodel 
)

Initializes the integer counts to 0.

Initializes the integer counts to 0. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe integer counts to initialize.
amodelThe acoustic model which was used to create the counts.
tL_amicounts_init_hmm ( tLAMiCounts counts,
const tLAModel amodel,
const unsigned int  c 
)

Initializes the integer counts of an HMM to 0.

Initializes the integer counts of the designated HMM to 0. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe integer counts to initialize.
amodelThe acoustic model which was used to create the counts.
cHMM to be initialized.
tL_amicounts_init_hmm_val ( tLAMiCounts counts,
const tLAModel amodel,
const unsigned int  c,
const unsigned long  val 
)

Initializes the integer counts of an HMM.

Initializes the integer counts of the designated HMM to val. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe integer counts to initialize.
amodelThe acoustic model which was used to create the counts.
cHMM to be initialized.
valValue.
tL_amicounts_init_val ( tLAMiCounts counts,
const tLAModel amodel,
const unsigned long  val 
)

Initializes the integer counts.

Initializes the integer counts to val. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe integer counts to initialize.
amodelThe acoustic model which was used to create the counts.
valValue.
tL_amicounts_new ( const tLAModel amodel)

Creates a new AMiCounts.

Creates a new AMiCounts to store the integer counts of the parameters of the provided HMMs. Counts are not initialized.

Parameters:
amodelThe provided HMMs.
Returns:
The new AMiCounts.
tL_amicounts_print ( const tLAMiCounts counts,
const tLAModel amodel,
FILE *  to,
const tLBool  binary 
)

Prints the integer counts.

This function prints the integer counts to a file in text or binary format. Counts are printed in the same order as the parameters of amodel are printed. The binary format is not a compact nor portable representation, but a way to ensure that counts are written like they are stored in memory. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe integer counts.
amodelThe acoustic model which was used to create the counts.
toFile to which the counts will be printed.
binaryIf TRUE, counts are printed in binary format; else, in text format.
tL_amicounts_read ( const tLAMiCounts counts,
const tLAModel amodel,
gzFile  from,
const tLBool  binary,
char **  err 
)

Reads the integer counts from file.

This function reads the integer counts from the provided file, in text or binary format, overwriting the current counts. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe integer counts.
amodelThe acoustic model which was used to create the counts.
fromFile where counts are stored.
binaryIf TRUE, stored counts are assumed to be in binary format; else, in text format.
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
Returns:
0 if counts have been successfully read, -1 otherwise.
tL_amicounts_update_amodel ( const tLAMiCounts counts,
tLAModel amodel 
)

Update parameters.

This function uses the current integer counts to reestimate the parameters of the given acoustic model. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one. This function is only supported by HMMs with linear topologies.

Parameters:
countsThe integer counts.
amodelThe acoustic model to update.
tL_amicounts_update_hmm ( const tLAMiCounts counts,
tLAModel amodel,
const unsigned int  c 
)

Update parameters of an HMM.

This function uses the current integer counts to reestimate the parameters of the given HMM. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one. This function is only supported by HMMs with linear topologies.

Parameters:
countsThe integer counts.
amodelThe acoustic model to update.
cHMM to be updated.
tL_amlogcounts_accum ( const tLAMlogCounts counts,
const tLAModel amodel,
gzFile  from,
const tLBool  binary,
char **  err 
)

Accumulates the logarithmic counts from file.

This function reads the logarithmic counts from the provided file, in text or binary format, and then accumulates the read counts over the current counts. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe logarithmic counts.
amodelThe acoustic model which was used to create the counts.
fromFile where counts are stored.
binaryIf TRUE, stored counts are assumed to be in binary format; else, in text format.
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
Returns:
0 if counts have been successfully accumulated, -1 otherwise.
tL_amlogcounts_accum_eps ( const tLAMlogCounts counts,
const tLAModel amodel,
gzFile  from,
const tLFloat  eps,
const tLBool  binary,
char **  err 
)

Interpolates current logarithmic counts with the logarithmic counts from file.

This function reads the logarithmic counts from the provided file, in text or binary format, and then interpolates them with the current counts, $\mbox{Current}\cdot(1-\epsilon) + \mbox{New}\cdot\epsilon$. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe logarithmic counts.
amodelThe acoustic model which was used to create the counts.
fromFile where counts are stored.
epsThe epsilon value, must be $0\leq\epsilon\leq 1$.
binaryIf TRUE, stored counts are assumed to be in binary format; else, in text format.
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
Returns:
0 if counts have been successfully accumulated, -1 otherwise.
tL_amlogcounts_free ( tLAMlogCounts counts,
const tLAModel amodel 
)

Frees memory.

Frees the memory allocated for the logarithmic counts. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe logarithmic counts to free.
amodelThe acoustic model which was used to create the counts.
tL_amlogcounts_get_mixcounts ( tLAMlogCounts counts,
const tLAModel amodel,
char **  err 
)

Returns the counts of the mixture coefficients.

This function is only applicable to HMMs of the type Mixture or TiedState Mixture.

Parameters:
countsThe logarithmic counts.
amodelThe acoustic model.
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
Returns:
The mixture coefficient counts, or NULL in case of error.
tL_amlogcounts_init ( tLAMlogCounts counts,
const tLAModel amodel 
)

Initializes the logarithmic counts to -INF.

Initializes the logarithmic counts to -INF (-HUGE_VAL). It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe logarithmic counts to initialize.
amodelThe acoustic model which was used to create the counts.
tL_amlogcounts_init_hmm ( tLAMiCounts counts,
const tLAModel amodel,
const unsigned int  c 
)

Initializes the logarithmic counts of an HMM to -INF.

Initializes the logarithmic counts of the designated HMM to -INF. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe logarithmic counts to initialize.
amodelThe acoustic model which was used to create the counts.
cHMM to be initialized.
tL_amlogcounts_init_hmm_val ( tLAMiCounts counts,
const tLAModel amodel,
const unsigned int  c,
const tLFloat  val 
)

Initializes the logarithmic counts of an HMM.

Initializes the logarithmic counts of the designated HMM to val. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe logarithmic counts to initialize.
amodelThe acoustic model which was used to create the counts.
cHMM to be initialized.
valValue.
tL_amlogcounts_init_val ( tLAMlogCounts counts,
const tLAModel amodel,
const tLFloat  val 
)

Initializes the logarithmic counts.

Initializes the logarithmic counts to val. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe logarithmic counts to initialize.
amodelThe acoustic model which was used to create the counts.
valValue.
tL_amlogcounts_new ( const tLAModel amodel)

Creates a new AMlogCounts.

Creates a new AMlogCounts to store the logarithmic counts of the parameters of the provided acoustic model. Counts are not initialized.

Parameters:
amodelThe provided acoustic model.
Returns:
The new AMlogCounts.
tL_amlogcounts_new_cmllr ( const tLAModel amodel)

Creates a new AMlogCounts for CMLLR.

Creates a new AMlogCounts to store the logarithmic counts, as 'tL_amlogcounts_new', prepared for the CMLLR algorithm. Counts are not initialized.

Parameters:
amodelThe provided acoustic model.
Returns:
The new AMlogCounts.
tL_amlogcounts_new_mllr ( const tLAModel amodel)

Creates a new AMlogCounts for MLLR.

Creates a new AMlogCounts to store the logarithmic counts, as 'tL_amlogcounts_new', prepared for the MLLR algorithm. Counts are not initialized.

Parameters:
amodelThe provided acoustic model.
Returns:
The new AMlogCounts.
tL_amlogcounts_print ( const tLAMlogCounts counts,
const tLAModel amodel,
FILE *  to,
const tLBool  binary 
)

Prints the logarithmic counts.

This function prints the logarithmic counts into a file in text or binary format. Counts are printed in the same order as the parameters of amodel are printed. The binary format is not a compact nor portable representation, but a way to ensure that counts are written like they are stored in memory. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe logarithmic counts.
amodelThe acoustic model which was used to create the counts.
toFile to which the counts will be printed.
binaryIf TRUE, counts are printed in binary format; else, in text format.
tL_amlogcounts_read ( const tLAMlogCounts counts,
const tLAModel amodel,
gzFile  from,
const tLBool  binary,
char **  err 
)

Reads the logarithmic counts from file.

This function reads the logarithmic counts from the provided file, in text or binary format, overwriting the current counts. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one.

Parameters:
countsThe logarithmic counts.
amodelThe acoustic model which was used to create the counts.
fromFile where counts are stored.
binaryIf TRUE, stored counts are assumed to be in binary format; else, in text format.
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
Returns:
0 if counts have been successfully read, -1 otherwise.
tL_amlogcounts_update_amodel ( const tLAMlogCounts counts,
tLAModel amodel 
)

Update parameters.

This function uses the current logarithmic counts to reestimate the parameters of the given acoustic model. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one. This function is only supported by HMMs with linear topologies.

Parameters:
countsThe logarithmic counts.
amodelThe acoustic model to update.
tL_amlogcounts_update_hmm ( const tLAMlogCounts counts,
tLAModel amodel,
const unsigned int  c 
)

Update parameters of an HMM.

This function uses the current logarithmic counts to reestimate the parameters of the given HMM. It is mandatory to provide the acoustic model which was used to create the counts, or a topologically equivalent one. This function is only supported by HMMs with linear topologies.

Parameters:
countsThe logarithmic counts.
amodelThe acoustic model to update.
cHMM to be updated.
tL_mixcounts_free ( tLMixCounts mcounts,
const tLAModel amodel 
)

Frees mixture counts.

This function frees the memory allocated for the mixture coefficient counts.

Parameters:
mcountsThe mixture coefficient counts.
amodelThe acoustic model which was used to create the counts.
tL_mixcounts_print ( const tLMixCounts mcounts,
const tLAModel amodel,
const tLDict syms,
FILE *  to 
)

Prints mixture counts.

This function prints the mixture coefficient counts in text format.

Parameters:
mcountsThe mixture coefficient counts.
amodelThe acoustic model which was used to create the counts.
symsThe symbol dictionary.
toFile to which the counts will be printed.
tL_mixcounts_read ( const tLAModel amodel,
gzFile  from,
char **  err 
)

Reads mixture counts from file.

This function reads the mixture coefficient counts from the file provided. The labels in the file are ignored, therefore what is important is the order of the counts in the file.

Parameters:
amodelThe acoustic model which was used to create the counts stored in the file.
fromFile where counts are stored.
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
Returns:
The mixture coefficient counts, or NULL in case of error.
tL_occupancies_init ( tLFloat **  occs,
const tLAModel amodel 
)

Inits the occupancy values.

Inits to zero (-HUGE_VAL) all the occupancy values.

Parameters:
occsThe occupancy values.
amodelThe acoustic model related to the occupancy values.
tL_occupancies_new ( const tLAModel amodel)

Allocs memory to store the occupancies.

This function allocs a matrix to store state occupancies of the specified acoustic model. The matrix is accessed as follows: m[c][q]; where 'c' is the index related to the HMM and 'q' the index related to the state. Occupancy values are stored using logarithms.

Parameters:
amodelThe acoustic model.
Returns:
The allocated memory.
tL_occupancies_print ( tLFloat **  occs,
FILE *  to,
const tLAModel amodel,
const tLDict syms 
)

Prints the occupancy values.

This function prints the values of the occupancies in plain text format.

Parameters:
occsThe occupancy values.
toFile to which the occupancy values will be printed.
amodelThe acoustic model related to the occupancy values.
symsA dictionary with the symbols related to the HMMs.
 All Data Structures Variables