libak
0.4.0
|
Functions | |
void | ak_trainer_free (akTrainer *trainer) |
Frees memory. | |
akTrainer * | ak_trainer_new (akCModel *cmodel, akCMlogCounts *counts, const akSeqs *seqs, akFloat **occs, char **err) |
Gets an akTrainer. | |
akProb | ak_train (akTrainer *trainer, const akFea *fea, const size_t seq) |
Updates character model counts according to the EM algorithm. |
Updates character model counts according to the EM algorithm.
This function increase the character model counts, which are stored in the provided trainer, from one sample (feature vector sequence) and its transcription, using the EM algorithm in order to obtain the logarithmic counts. The sequence is specified as an integer code according to the sequence manager used during the creation of the trainer.
trainer | The trainer. |
fea | A feature vector manager, which must contain a sequence of feature vectors of an adequate type for the cmodel. |
seq | The code of the transcription of the sample. |
void ak_trainer_free | ( | akTrainer * | trainer | ) |
Frees memory.
Frees the memory allocated for the trainer.
trainer | The trainer. |
akTrainer* ak_trainer_new | ( | akCModel * | cmodel, |
akCMlogCounts * | counts, | ||
const akSeqs * | seqs, | ||
akFloat ** | occs, | ||
char ** | err | ||
) |
Gets an akTrainer.
This function creates a trainer used to train character models from transcriptions using the EM algorithm. This data only can be used to train the character sequences stored in seqs during the creation of the auxiliary data. Currently supported types are: Bernoulli, DGaussian and Mixture.
cmodel | The character models. |
counts | The logarithmic counts which will be increased. |
seqs | A character sequence manager containing the character sequences which can be used to train samples. |
occs | If not null, it must be a pointer to a matrix in which the state occupancy values will be accumulated. |
err | Pointer to string variable. If not NULL an error message is allocated in the variable in case of error. |