public FeedforwardNeuronalNetwork CreateNeuronalNetwork(
            int inputNeurons, int outputNeurons, int evolutions = 1000, double learningRate = 0.5)
        {
            var neuronCounter = new NeuronCounter(inputNeurons, outputNeurons);

            return(new FeedforwardNeuronalNetwork(neuronCounter, evolutions, learningRate));
        }
Beispiel #2
0
        public NeuronalNetworkClassifier(List <Tuple <double[], double[]> > data,
                                         int inputNeurons, int outputNeurons, int evolutions = 1000, double learningRate = 0.5)
        {
            var neuronCounter = new NeuronCounter(inputNeurons, outputNeurons);

            this.data = data;
            this.feedforwardNeuronalNetwork = new FeedforwardNeuronalNetwork(neuronCounter, evolutions, learningRate);
        }
 public FeedforwardNeuronalNetwork(NeuronCounter neuronCounter, int evolutions = 1000,
                                   double learningRate = 0.5)
 {
     this.mode              = NeuronalCounterMode.ZeroHiddenLayer;
     this.neuronCounter     = neuronCounter;
     this.evolutions        = evolutions;
     this.learningRate      = learningRate;
     this.inputValuesCount  = neuronCounter.InputNeuronCount;
     this.outputValuesCount = neuronCounter.OutputNeuronCount;
     this.neuronalNetwork.AddInputLayer(new FeedforwardLayer(activationFunction, neuronCounter.InputNeuronCount, 0));
     this.neuronalNetwork.AddOutputLayer(new FeedforwardLayer(activationFunction, neuronCounter.OutputNeuronCount, 1));
     this.neuronalNetwork.LearningRate        = learningRate;
     this.neuronalNetwork.Evolutions          = evolutions;
     this.neuronalNetwork.NeuronalNetworkMode = NeuronalNetworkMode.Standard;
     this.neuronalNetwork.RandomFillWeightMatrix();
 }
 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();
 }