Exemplo n.º 1
0
 public Backpropagation(IContainsFlat network, IMLDataSet training, double learnRate, double momentum)
     : base(network, training)
 {
     ValidateNetwork.ValidateMethodToData(network, training);
     TrainFlatNetworkBackPropagation propagation = new TrainFlatNetworkBackPropagation(network.Flat, this.Training, learnRate, momentum);
     base.FlatTraining = propagation;
 }
 /// <param name="network">The network that is to be trained</param>
 /// <param name="training">The training set</param>
 /// <param name="learnRate"></param>
 /// <param name="momentum"></param>
 public Backpropagation(IContainsFlat network,
                        IMLDataSet training, double learnRate,
                        double momentum) : base(network, training)
 {
     ValidateNetwork.ValidateMethodToData(network, training);
     var backFlat = new TrainFlatNetworkBackPropagation(
         network.Flat, Training, learnRate, momentum);
     FlatTraining = backFlat;
 }
Exemplo n.º 3
0
        public static long BenchmarkEncogFlat(double[][] input, double[][] output)
        {
            var network = new FlatNetwork(input[0].Length, HIDDEN_COUNT, 0,
                                          output[0].Length, false);
            network.Randomize();
            var trainingSet = new BasicMLDataSet(input, output);

            var train = new TrainFlatNetworkBackPropagation(
                network, trainingSet, 0.7, 0.7);

            var a = new double[2];
            var b = new double[1];

            var sw = new Stopwatch();
            sw.Start();
            // run epoch of learning procedure
            for (int i = 0; i < ITERATIONS; i++)
            {
                train.Iteration();
            }
            sw.Stop();

            return sw.ElapsedMilliseconds;
        }