libak  0.4.0
Functions
Viterbi training from transcriptions of character models
Algorithms

Functions

void ak_vtrainer_free (akVTrainer *vtrainer)
 Frees memory.
akVTrainer * ak_vtrainer_new (const akCModel *cmodel, akCMiCounts *counts, const akSeqs *seqs, char **err)
 Gets an akVTrainer.
akProb ak_vtrain (akVTrainer *vtrainer, const akFea *fea, const size_t seq)
 Updates character model counts according to the Viterbi algorithm.

Function Documentation

akProb ak_vtrain ( akVTrainer *  vtrainer,
const akFea fea,
const size_t  seq 
)

Updates character model counts according to the Viterbi algorithm.

This function increase the character model counts, which are stored in the trainer, from one sample (feature vector sequence) and its transcription, using the Viterbi algorithm in order to obtain the integer counts. The sequence is specified as an integer code according to the sequence manager used during the creation of the viterbi trainer.

Parameters:
vtrainerThe viterbi 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_vtrainer_free ( akVTrainer *  vtrainer)

Frees memory.

Frees the memory allocated for the auxiliary data.

Parameters:
vtrainerThe Viterbi trainer.
akVTrainer* ak_vtrainer_new ( const akCModel cmodel,
akCMiCounts counts,
const akSeqs seqs,
char **  err 
)

Gets an akVTrainer.

This function creates auxiliary data used to train character models from transcriptions using the Viterbi algorithm. This data only can be used to train the character sequences stored in seqs during the creation of the trainer. Currently supported types are: Bernoulli, DGaussian and Mixture.

Parameters:
cmodelThe character models.
countsThe integer counts which will be increased.
seqsA character sequence manager containing the character sequences which can be used to train samples.
errPointer to string variable. If not NULL an error message is allocated in the variable in case of error.
Returns:
Viterbi trainer or NULL in case of error.
 All Data Structures Variables