Exemple #1
0
        static void ZikoHugouka(List <DenseVector> Me)
        {
            UseNN Ziko = new UseNN();

            Ziko.Add(new int[] { Me[0].Count, Me[0].Count / 2, Me[0].Count }, new int[] { 0, 0, 0 });
            List <DenseVector[]> xds = new List <DenseVector[]>();

            for (int i = 0; i < Me.Count; i++)
            {
                xds.Add(new DenseVector[] { Me[i], Me[i] }); //inputとoutputは同じが理想
            }
            Ziko.BatchInit(-1, 1);                           //バッチ処理は利用しない
            Ziko.DataInit(xds, xds);                         //テスト集合と訓練集合は同一
            Ziko.NNinit();
            Ziko.Train();
        }
Exemple #2
0
        static void Use()
        {
            //////////データ用意
            Random rnd = new Random();
            List <DenseVector[]> xds = new List <DenseVector[]>();

            for (int i = 0; i < 1000000; i++)
            {
                xds.Add(new DenseVector[2] {
                    new DenseVector(1), new DenseVector(1)
                });
                double a = rnd.NextDouble();
                xds[i][0][0] = a; xds[i][1][0] = a * a;
            }

            List <DenseVector[]> Tests = new List <DenseVector[]>();

            for (int i = 0; i < 100; i++)
            {
                Tests.Add(new DenseVector[2] {
                    new DenseVector(1), new DenseVector(1)
                });
                double a = rnd.NextDouble();
                Tests[i][0][0] = a; Tests[i][1][0] = a * a;
            }
            //////////データ用意終


            UseNN test = new UseNN();

            test.Add(new int[] { 1, 3, 1 }, new int[] { 0, 0, 0 });
            test.BatchInit(10000, 10);
            test.DataInit(xds, Tests);
            test.NNinit();
            test.Train();
            test.Test();
            Console.ReadLine();
        }