Example #1
0
        public void TestNeuralNetTrainingData()
        {
            InitializePresets(2, 2, 2);
            neuralNetworkTraining.Train(
                new List <Tuple <IList <double>, IList <double> > >
            {
                new Tuple <IList <double>, IList <double> >(new [] { .05, .10 }, new [] { .01, .99 }),
            });

            var val = new List <double> {
                .05, .10
            };

            neuralNetwork.Evaluate(val);

            Assert.IsTrue(Math.Abs(neuralNetwork.OutputLayer.OutputValues[0] - .01) <= .005);
            Assert.IsTrue(Math.Abs(neuralNetwork.OutputLayer.OutputValues[1] - .99) <= .005);
        }