libak
0.4.0
|
Functions | |
void | ak_cmllr_adapt_fea (akCMLLR *cmllr, const akFea *fea_in, akFea *fea_out) |
Adapt a feature sequence. | |
void | ak_cmllr_free (akCMLLR *cmllr) |
Frees memory. | |
akFloat | ak_cmllr_get_lv_constant (const akCMLLR *cmllr, const akCMlogCounts *counts) |
Gets the additional ![]() | |
void | ak_cmllr_init (akCMLLR *cmllr) |
Initializes the CMLLR transformation matrix. | |
akCMLLR * | ak_cmllr_new (akCModel *cmodel, char **err) |
Get an akCMLLR. | |
void | ak_cmllr_print_matrix (const akCMLLR *cmllr, FILE *to) |
Prints the transformation matrix. | |
int | ak_cmllr_read_matrix (const akCMLLR *cmllr, FILE *from, char **err) |
Reads the transformation matrix. | |
void | ak_cmllr_update_matrix (akCMLLR *cmllr, const akCMlogCounts *counts, const unsigned int niters) |
Update the transformation matrix. |
void ak_cmllr_adapt_fea | ( | akCMLLR * | cmllr, |
const akFea * | fea_in, | ||
akFea * | fea_out | ||
) |
Adapt a feature sequence.
This function apply the CMLLR transformation matrix to the feature sequence stored in the provided feature sequence manager. The feature sequence is supposed to be real and to have the same dimension than the character models related to the CMLLR structure.
cmllr | The CMLLR structure. |
fea_in | A feature sequence manager with the real feature sequence to adapt. |
fea_out | The feature sequence manager where the transformed sequence will be stored. |
void ak_cmllr_free | ( | akCMLLR * | cmllr | ) |
Frees memory.
Frees the memory allocated for the CMLLR structure.
cmllr | The CMLLR structure. |
akFloat ak_cmllr_get_lv_constant | ( | const akCMLLR * | cmllr, |
const akCMlogCounts * | counts | ||
) |
Gets the additional term.
This function calculates the additional term , which must be added to log-likelihood.
cmllr | The CMLLR structure. |
counts | Logarithmic counts related to the character models of the CMLLR structure. |
void ak_cmllr_init | ( | akCMLLR * | cmllr | ) |
Initializes the CMLLR transformation matrix.
This function initializes the CMLLR transformation matrix. The A matrix is initialized to the identity matrix, and the b vector is initialized with zeroes.
cmllr | The CMLLR structure. |
akCMLLR* ak_cmllr_new | ( | akCModel * | cmodel, |
char ** | err | ||
) |
Get an akCMLLR.
This function creates a CMLLR structure used to adapt models and transform features using the CMLLR technique. Only DGaussian based types are supported. This function calls 'ak_cmllr_init'.
cmodel | The character models. |
err | Pointer to string variable. If not NULL an error message is allocated in the variable in case of error. |
void ak_cmllr_print_matrix | ( | const akCMLLR * | cmllr, |
FILE * | to | ||
) |
Prints the transformation matrix.
This functions prints the CMLLR transformation matrix in the specified file.
cmllr | The CMLLR structure. |
to | File where the matrix is written. |
int ak_cmllr_read_matrix | ( | const akCMLLR * | cmllr, |
FILE * | from, | ||
char ** | err | ||
) |
Reads the transformation matrix.
This functions reads the CMLLR transformation matrix from the specified file.
cmllr | The CMLLR structure. |
from | File where the matrix is stored. |
err | Pointer to string variable. If not NULL an error message is allocated in the variable in case of error. |
void ak_cmllr_update_matrix | ( | akCMLLR * | cmllr, |
const akCMlogCounts * | counts, | ||
const unsigned int | niters | ||
) |
Update the transformation matrix.
This function recalculates the CMLLR transformation matrix, using the previous values and the provided logarithmic counts. When niters is 0 diagonal CMLLR matrix is calculated. When full matrix is calculated, counts must be created using 'ak_cmlogcounts_new_cmllr'.
cmllr | The CMLLR structure. |
counts | Logarithmic counts related to the character models of the CMLLR structure. The counts must be created using 'ak_cmlogcounts_new_cmllr' i niters>0. |
niters | The number of iterations for the CMLLR, or 0 to indicate that diagonal CMLLR matrix must be calculated. algorithm. Must be greather than 0. |