Пример #1
0
        public static void CompareMseDemo(int epoches, params int[] layers)
        {
            Console.WriteLine($"[CompareMseDemo] [Network: {string.Join(",", layers)}] [Epoches: {epoches}]");
            var       optimizer1 = SGD(Network(SIGM, 2, 1, layers), 0.3);
            var       optimizer2 = SGD(Network(SIGM, 2, 1, layers), 0.1);
            var       optimizer3 = SGDMomentum(Network(SIGM, 2, 1, layers), 0.3, 0.5);
            var       optimizer4 = SGDMomentum(Network(SIGM, 2, 1, layers), 0.1, 0.5);
            ChartForm chartForm  = new ChartForm();

            chartForm.Add(optimizer1, Train(optimizer1, Data, epoches));
            chartForm.ShowDialog();
        }
Пример #2
0
        public static void Compare3()
        {
            int epoches = 30;
            var data    = TicTacToeValueLoader.LoadAllUniqueStates(Storage.Instance);
            List <Optimizer> optimizers = new List <Optimizer>();

            optimizers.Add(SGDMomentum(Network(RELU, 9, 3, 72, 72, 72, 36, 36, 36, 18, 18), 0.001, 0.04));
            optimizers.Add(SGDMomentum(Network(LEAKY, 9, 3, 72, 72, 72, 36, 36, 36, 18, 18), 0.001, 0.04));
            ChartForm chartForm = new ChartForm("TicTacToe");

            foreach (var optimizer in optimizers)
            {
                chartForm.Add(optimizer, Train(optimizer, data, epoches, 1, Monitors(MSE)));
            }

            chartForm.ShowDialog();
        }
Пример #3
0
        public static void Compare4()
        {
            int epoches = 600;
            var data    = TicTacToeValueLoader.LoadAllUniqueStates(Storage.Instance);
            //List<Optimizer> optimizers = new List<Optimizer>();
            var optimizer1 = SGDMomentum(Network(RELU, 9, 3, 72, 72, 72, 36, 36, 36, 18, 18), 0.001, 0.04);
            var optimizer2 = SGDMomentum(Network(RELU, 9, 3, 72, 72, 72, 36, 36, 36, 18, 18), 0.001, 0.04);
            var optimizer3 = SGDMomentum(Network(RELU, 9, 3, 72, 72, 72, 36, 36, 36, 18, 18), 0.001, 0.04);
            var optimizer4 = AdaGrad(Network(RELU, 9, 3, 72, 72, 72, 36, 36, 36, 18, 18), 0.01);
            //optimizers.Add(AdaGrad(Network(RELU, 9, 3, 72, 72, 72, 36, 36, 36, 18, 18), 0.001));
            ChartForm chartForm = new ChartForm("TicTacToe");

            //chartForm.Add(optimizer1, Train(optimizer1, @in, @out, epoches, 1, Monitors(MSE)));
            //chartForm.Add(optimizer2, Train(optimizer2, @in, @out, epoches, 8, Monitors(MSE)));
            chartForm.Add(optimizer3, Train(optimizer3, data, epoches, 32, Monitors(MSE)));
            chartForm.Add(optimizer4, Train(optimizer4, data, epoches, 32, Monitors(MSE)));
            chartForm.ShowDialog();
        }
Пример #4
0
        public static void Compare()
        {
            int epoches    = 6000;
            var optimizer1 = SGD(Network(SIGM, 2, 1, 4), 0.3);
            var optimizer2 = SGD(Network(SIGM, 2, 1, 4, 6), 0.3);
            var optimizer3 = SGD(Network(SIGM, 2, 1, 40, 80, 60), 0.1);
            var optimizer4 = SGD(Network(RELU, 2, 1, 4), 0.03);
            //var optimizer5 = SGD(Network(RELU, 2, 1, 4, 6), 0.9); nie reaguje na LR
            var       optimizer6 = SGD(Network(RELU, 2, 1, 40, 80, 60), 0.003);
            ChartForm chartForm  = new ChartForm("Xor");

            chartForm.Add(optimizer1, Train(optimizer1, Data, epoches, 1, MSE));
            chartForm.Add(optimizer2, Train(optimizer2, Data, epoches, 1, MSE));
            chartForm.Add(optimizer3, Train(optimizer3, Data, epoches, 1, MSE));
            chartForm.Add(optimizer4, Train(optimizer4, Data, epoches, 1, MSE));
            //chartForm.Add(optimizer5, Train(optimizer5, Inputs, Outputs, epoches, MSE));
            chartForm.Add(optimizer6, Train(optimizer6, Data, epoches, 1, MSE));
            chartForm.ShowDialog();
        }