public void LearnTest9()
{
double[][][] inputs = large_gestures;
int[] outputs = large_outputs;
int states = 5;
int iterations = 100;
double tolerance = 0.01;
bool rejection = true;
double sensitivity = 1E-85;
int dimension = inputs[0][0].Length;
var hmm = new HiddenMarkovClassifier<MultivariateNormalDistribution>(2,
new Forward(states), new MultivariateNormalDistribution(dimension));
// Create the learning algorithm for the ensemble classifier
var teacher = new HiddenMarkovClassifierLearning<MultivariateNormalDistribution>(hmm,
// Train each model using the selected convergence criteria
i => new BaumWelchLearning<MultivariateNormalDistribution>(hmm.Models[i])
{
Tolerance = tolerance,
Iterations = iterations,
FittingOptions = new NormalOptions()
{
Regularization = 1e-5
}
}
);
teacher.Empirical = true;
teacher.Rejection = rejection;
// Run the learning algorithm
double logLikelihood = teacher.Run(inputs, outputs);
hmm.Sensitivity = sensitivity;
for (int i = 0; i < large_gestures.Length; i++)
{
int actual = hmm.Compute(large_gestures[i]);
int expected = large_outputs[i];
Assert.AreEqual(expected, actual);
}
}