libak
0.4.0
|
Defines | |
#define | ak_train_viterbi_char(CVTRAINER, COUNTS, C, FEA) ak_train_viterbi_char_seg ( CVTRAINER, COUNTS, C, FEA, 0, (FEA)->cols ) |
Trains a character model from a sample using the Viterbi algorithm. | |
Functions | |
void | ak_char_vtrainer_free (akCharVTrainer *cvtrainer) |
Frees memory. | |
akCharVTrainer * | ak_char_vtrainer_new (const akCModel *cmodel, char **err) |
Gets an akCharVTrainer. | |
akProb | ak_train_viterbi_char_seg (akCharVTrainer *cvtrainer, akCMiCounts *counts, const int c, const akFea *fea, const int begin, const int nframes) |
Trains a character model from a segment of sample using the Viterbi algorithm. |
#define ak_train_viterbi_char | ( | CVTRAINER, | |
COUNTS, | |||
C, | |||
FEA | |||
) | ak_train_viterbi_char_seg ( CVTRAINER, COUNTS, C, FEA, 0, (FEA)->cols ) |
Trains a character model from a sample using the Viterbi algorithm.
This macro is equivalent to ak_train_viterbi_char_seg but using all frames contained in fea.
CVTRAINER | The character Viterbi trainer. |
COUNTS | Integer counts related to CMODEL. |
C | The index of the character to be trained. |
FEA | A feature vectors manager, which must contain a sequence of feature vectors of an adequate type for the CMODEL. |
void ak_char_vtrainer_free | ( | akCharVTrainer * | cvtrainer | ) |
Frees memory.
Frees the memory allocated for the character Viterbi trainer.
cvtrainer | The character Viterbi trainer. |
akCharVTrainer* ak_char_vtrainer_new | ( | const akCModel * | cmodel, |
char ** | err | ||
) |
Gets an akCharVTrainer.
This function creates a character Viterbi trainer used to train character models with the Viterbi algorithm. Currently supported types are: See akCharInitializer.
cmodel | The character models. |
err | Pointer to string variable. If not NULL an error message is allocated in the variable in case of error. |
akProb ak_train_viterbi_char_seg | ( | akCharVTrainer * | cvtrainer, |
akCMiCounts * | counts, | ||
const int | c, | ||
const akFea * | fea, | ||
const int | begin, | ||
const int | nframes | ||
) |
Trains a character model from a segment of sample using the Viterbi algorithm.
This function finds the maximum probability path for the specified char of input frames, which are a segment of the given feature vector sequence, and for each transition used increments the related count by one. Furthermore, the maximum probability path is used to assign the input frames to states, then, states counts are increased as in ak_init_char.
cvtrainer | The character Viterbi trainer. |
counts | Integer counts related to cmodel. |
c | The index of the character to be trained. |
fea | A feature vectors manager, which must contain a sequence of feature vectors of an adequate type for the cmodel. |
begin | The first input frame. |
nframes | The number of input frames. |