Beispiel #1
0
 static void train(NeuralNetworkChoise net)
 {
     net.train(new double[] { 0, 0 }, 0);
     net.train(new double[] { 1, 0 }, 1);
     net.train(new double[] { 0, 1 }, 1);
     net.train(new double[] { 1, 1 }, 0);
 }
Beispiel #2
0
 static void getResults(NeuralNetworkChoise net)
 {
     Console.WriteLine("{");
     Console.WriteLine(net.getResult(new double[] { 0, 0 }));
     Console.WriteLine(net.getResult(new double[] { 1, 0 }));
     Console.WriteLine(net.getResult(new double[] { 0, 1 }));
     Console.WriteLine(net.getResult(new double[] { 1, 1 }));
     Console.WriteLine("}");
 }
Beispiel #3
0
        static void SecondTest()
        {
            Dictionary <int, String> dictionary = new Dictionary <int, string>();

            dictionary.Add(0, "0");
            dictionary.Add(1, "1");
            NeuralNetworkChoise net = new NeuralNetworkChoise(2, dictionary, new int[] { 2 });

            getResults(net);
            for (int i = 0; i < 10000; i++)
            {
                train(net);
            }
            getResults(net);
        }