libak  0.4.0
Functions
EM training from transcriptions of character models
Algorithms

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.

Function Documentation

akProb ak_train ( akTrainer *  trainer,
const akFea fea,
const size_t  seq 
)

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.

Parameters:
trainerThe trainer.
feaA feature vector manager, which must contain a sequence of feature vectors of an adequate type for the cmodel.
seqThe code of the transcription of the sample.
Returns:
The sample probability for that transcription, -HUGE_VAL in the case the sample can not be used to update the counts.
void ak_trainer_free ( akTrainer *  trainer)

Frees memory.

Frees the memory allocated for the trainer.

Parameters:
trainerThe 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.

Parameters:
cmodelThe character models.
countsThe logarithmic counts which will be increased.
seqsA character sequence manager containing the character sequences which can be used to train samples.
occsIf not null, it must be a pointer to a matrix in which the state occupancy values will be accumulated.
errPointer to string variable. If not NULL an error message is allocated in the variable in case of error.
Returns:
Trainer or NULL in case of error.
 All Data Structures Variables