public FeedforwardNeuronalNetwork CreateNeuronalNetwork( int inputNeurons, int outputNeurons, int firstHiddenLayerNeurons, int evolutions = 1000, double learningRate = 0.5) { var neuronCounter = new OneHiddenLayerNeuronCounter(inputNeurons, outputNeurons, firstHiddenLayerNeurons); return(new FeedforwardNeuronalNetwork(neuronCounter, evolutions, learningRate)); }
public NeuronalNetworkClassifier(List <Tuple <double[], double> > data, int inputNeurons, int outputNeurons, int firstHiddenLayerNeurons, int evolutions = 1000, double learningRate = 0.5, NeuronalNetworkMode neuronalNetworkMode = NeuronalNetworkMode.Standard) { var neuronCounter = new OneHiddenLayerNeuronCounter(inputNeurons, outputNeurons, firstHiddenLayerNeurons); this.dataOneOutput = data; this.feedforwardNeuronalNetwork = new FeedforwardNeuronalNetwork(neuronCounter, evolutions, learningRate, neuronalNetworkMode); }
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(); }