Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            int       outnodes = 10;
            NeuralNet net      = new NeuralNet(false, "SkyNet", 784, 2, 16, outnodes, new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" });

            Console.WriteLine("Loading data to memory...");

            net.LoadToMemory();
            int t = 0;

            while (true)
            {
                Console.WriteLine("Test Nr {0}", t);
                Console.WriteLine("#############################################");
                string dir = @"A:\Media\dfjdh\Visual Studio 2017\Projects\NeuralNetwork\NeuralNetTest\bin\Debug\mnist_jpgfiles\test\mnist_6_559.jpg";
                var    arr = net.RunImage(dir);
                for (int i = 0; i < arr.Length; i++)
                {
                    Console.WriteLine("Output " + i + ": " + arr[i]);
                }
                Console.WriteLine();
                var fl = net.Cost(arr, new float[] { 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 });
                Console.WriteLine("Cost: {0}, Grade: {1}", fl, net.Grade(net.GetRating(fl)));
                Console.WriteLine("#############################################");
                t++;
                Console.ReadKey();
            }


            //16384
            //Bitmap bit = new Bitmap("rsz_turnberry_004.jpg");
            //var bite = bit.GetPixel(1, 1).B;
            //Console.WriteLine(bite.ToString());
        }