libak  0.4.0
Defines | Functions
Viterbi training of character models
Algorithms

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 Documentation

#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.

Parameters:
CVTRAINERThe character Viterbi trainer.
COUNTSInteger counts related to CMODEL.
CThe index of the character to be trained.
FEAA feature vectors manager, which must contain a sequence of feature vectors of an adequate type for the CMODEL.
Returns:
The log-probability of the maximum probability path.

Function Documentation

void ak_char_vtrainer_free ( akCharVTrainer *  cvtrainer)

Frees memory.

Frees the memory allocated for the character Viterbi trainer.

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

Parameters:
cmodelThe character models.
errPointer to string variable. If not NULL an error message is allocated in the variable in case of error.
Returns:
The character Viterbi trainer or NULL 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.

Parameters:
cvtrainerThe character Viterbi trainer.
countsInteger counts related to cmodel.
cThe index of the character to be trained.
feaA feature vectors manager, which must contain a sequence of feature vectors of an adequate type for the cmodel.
beginThe first input frame.
nframesThe number of input frames.
Returns:
The log-probability of the maximum probability path.
 All Data Structures Variables