public void runInstance(TestInstance instance)
        {
            neuralNet.setInput(instance.Input);
            neuralNet.forwardPass();
            double[] predicted = neuralNet.Output;
            double[] actual    = instance.Output;
            double[] error     = calculateError(actual, predicted);

            double totalError = calculateSSE(actual, predicted);


            neuralNet.backPropogate(alpha, actual);
        }
        private void printError(TestInstance instance)
        {
            neuralNet.setInput(instance.Input);
            neuralNet.forwardPass();
            double[] predicted = neuralNet.Output;
            double[] actual    = instance.Output;
            double[] error     = calculateError(actual, predicted);

            double totalError = calculateSSE(actual, predicted);

            string a = calculateSSE(actual, predicted) + "\t";
            string b = calculateSSE(actual, predicted) + "\t";

            for (int i = 0; i < actual.Count(); i++)
            {
                a += Math.Round(actual[i], 7) + " ";
                b += Math.Round(predicted[i], 7) + " ";
            }

            Console.WriteLine(a + "\n" + b);

            neuralNet.backPropogate(alpha, actual);
        }
Exemplo n.º 3
0
 public void add(TestInstance testInstance)
 {
     Instances.Add(testInstance);
 }