Exemple #1
0
 public Train Backpropagate(NeuronalNetwork neuronalNetwork,
                            double[][] input, double[][] ideal, double learningRate, double momentum)
 {
     this.neuronalNetwork = neuronalNetwork;
     this.input           = input;
     this.ideal           = ideal;
     this.learningRate    = learningRate;
     this.momentum        = momentum;
     return(new Train(this));
 }
 public FeedforwardNeuronalNetwork(OneHiddenLayerNeuronCounter neuronCounter, int evolutions = 1000, double learningRate = 0.5,
                                   NeuronalNetworkMode neuronalNetworkMode = NeuronalNetworkMode.Standard)
 {
     this.mode = NeuronalCounterMode.OneHiddenLayer;
     this.neuronalNetworkMode = neuronalNetworkMode;
     this.neuronCounter       = neuronCounter;
     this.evolutions          = evolutions;
     this.learningRate        = learningRate;
     this.inputValuesCount    = neuronCounter.InputNeuronCount;
     this.outputValuesCount   = neuronCounter.OutputNeuronCount;
     neuronalNetwork          = NeuronalNetworkModeFactory.CreateInstance(neuronalNetworkMode);
     this.neuronalNetwork.NeuronalNetworkMode = neuronalNetworkMode;
     this.neuronalNetwork.AddInputLayer(new FeedforwardLayer(activationFunction, neuronCounter.InputNeuronCount, 0));
     this.neuronalNetwork.AddHiddenLayer(new FeedforwardLayer(activationFunction, neuronCounter.FirstLayerHiddenNeuronCount, 1));
     this.neuronalNetwork.AddOutputLayer(new FeedforwardLayer(activationFunction, neuronCounter.OutputNeuronCount, 2));
     this.neuronalNetwork.LearningRate = learningRate;
     this.neuronalNetwork.Evolutions   = evolutions;
     this.neuronalNetwork.RandomFillWeightMatrix();
 }