Added Viterbi training.