Example #1
0
        static void SimpleVNNBackpropNoMomentumSpeedTest()
        {
            var nn = new vnn(INPUT_SIZE, HIDDEN_SIZE, OUTPUT_SIZE, (mlp) => addon.RandomizeUniform(mlp));
            var tr = new trainerNoMomentum(nn);

            WriteLine($"Time: {measureBackpropSpeed(nn, tr)}");
        }
Example #2
0
        public static void simple_portable(vnn nn)
        {
            //var tr = new trainerModern(nn);
            var tr   = new trainerNoMomentum(nn);
            var tset = data.DataSets.twoParamTest;

            Stopwatch    sw      = Stopwatch.StartNew();
            const double ACCRATE = 0.05;

            for (int i = 0; i < 500; i++)
            {
                //tr.TrainEpoch(tset.inputs, tset.outputs, 0.1, 0.9);
                for (int j = 0, to = tset.size; j < to; j++)
                {
                    tr.TrainOne(tset.inputs[j], tset.outputs[j], 0.1);
                }
            }
            var acc = tset.getAccuracy(nn, ACCRATE);

            // if (acc < 0.9) { throw new Exception($"Not enought accuracy: {acc.ToString("N2")}"); }

            WriteLine("Elapsed = " + sw.ElapsedMilliseconds + " ms.");
            WriteLine($"Accuracy (+-{ACCRATE}) = {acc.ToString("N2")}");
            WriteLine("Random MSE = " + tset.getRandomMSE(nn, 500));
        }
Example #3
0
            public VNNWrapper(vnn _nn, string _savepath)
            {
                this.savepath = _savepath;
                this.nn       = _nn;
                this.nncopy   = nn.Copy();
                tr            = new trainerNoMomentum(this.nncopy);

                slider     = vutils.VSlider.RunAsync();
                manip      = slider.AddWatch(setLearningRate, learningRate, 0, 0.2, 0.01);
                manip.Name = "Learning Rate";
            }
Example #4
0
        public void learnStart(string data_file)
        {
            open(data_file, out stream, out len, out nn, out nnfile, out dir, out file);
            tr   = new trainerNoMomentum(nn);
            prog = new progressing(this);

            reportTh = prog.ReportAsync();
            TrainingLoop();
            Save();
            End = true;
        }