public static CreateModel1 ( ) : |
||
return |
public static HiddenMarkovModel CreateModel1()
{
double[] initial = { 1.0, 0.0 };
double[,] transitions =
{
{ 1 / 3.0, 2 / 3.0 },
{ 0.00, 1.00 },
};
double[,] emissions =
{
{ 0.25, 0.25, 0.50 },
{ 0.05, 0.05, 0.90 }
};
HiddenMarkovModel model = new HiddenMarkovModel(transitions, emissions, initial);
return model;
}
public void ConditionalRandomFieldConstructorTest() { HiddenMarkovModel hmm = DiscreteHiddenMarkovModelFunctionTest.CreateModel1(); int states = 2; var function = new MarkovDiscreteFunction(hmm); var target = new ConditionalRandomField <int>(states, function); Assert.AreEqual(function, target.Function); Assert.AreEqual(2, target.States); }