예제 #1
0
        static void TestingOpen1()
        {
            int[] array = { 9, 20, 1 };

            NNModel model = NNModel.Open("nnmodel.dat");
            string  str1  = File.ReadAllText("TD2.txt");

            double[][] vs2 = JsonConvert.DeserializeObject <double[][]>(str1);
            for (int i = 0; i < vs2.Length; i++)
            {
                var inp = new double[9];
                var tmp = vs2[i];
                for (int j = 0; j < 9; j++)
                {
                    inp[j] = tmp[j] / tmp[j + 1];
                }
                model.Compute(inp).Neurons.ForEach(x =>
                {
                    Console.WriteLine(x.Value + "  ");
                });
                Console.WriteLine();
            }
            Console.ReadKey();
            //model.Save();
        }
예제 #2
0
        static void TestingOpen()
        {
            int[] array = { 9, 20, 1 };

            NNModel model = NNModel.Open("nnmodel.dat");
            string  str1  = File.ReadAllText("TD2.txt");

            double[][] vs2 = JsonConvert.DeserializeObject <double[][]>(str1);
            for (int i = 0; i < vs2.Length; i++)
            {
                model.Compute(NNModel.ReculcArray(vs2[i])).Neurons.ForEach(x =>
                {
                    Console.WriteLine(x.Value + "  ");
                });
                Console.WriteLine();
            }
            Console.WriteLine("_______");
            Console.ReadKey();
        }