Run() 공개 메소드

Runs the Baum-Welch learning algorithm for hidden Markov models.
Learning problem. Given some training observation sequences O = {o1, o2, ..., oK} and general structure of HMM (numbers of hidden and visible states), determine HMM parameters M = (A, B, pi) that best fit training data.
public Run ( ) : double
리턴 double
        private static ContinuousHiddenMarkovModel TrainHelper(double[][] sequences)
        {
            var hmm = new ContinuousHiddenMarkovModel(States, Symbols);
            var learner = new ContinuousBaumWelchLearning(hmm)
            {
                Tolerance = MinTolerance,
                Iterations = MaxIterations,
                FittingOptions = new NormalOptions()
                {
                    Regularization = RegularisationFactor
                }
            };

            learner.Run(sequences);
            return hmm;
        }
예제 #2
0
파일: HMM.cs 프로젝트: smanoharan/314Kinect
        /// <summary>
        /// Train this current Hidden Markov Model using the provided sequences.
        /// 
        /// A subset of the features can be selected by the selectFeatures function.
        /// </summary>
        /// <param name="sequences">The set of training examples</param>
        /// <param name="selectFeatures">
        ///     A (function: Seq -> double[][]) which selects the relevant features from the sequence.
        /// </param>
        public void Train(IList<Sequence> sequences, Func<Sequence, double[][]> selectFeatures)
        {
            var learner = new ContinuousBaumWelchLearning(CHMM)
            {
                Tolerance = MinTolerance,
                Iterations = MaxIterations,

                // This is necessary to prevent overfitting:
                FittingOptions = new NormalOptions {Regularization = RegularisationFactor}
            };

            learner.Run(sequences.Select(selectFeatures).ToArray());
        }