/// <summary> /// Build a new Genetic NeuralNetwork from the Neural Network given as parameter /// </summary> /// <param name="n">The neural network model</param> public GeneticNeuralNetwork(NeuralNetwork n) { nn = n; int size = 0; for(int i=0; i<nn.N_Layers; i++) size += (nn[i].N_Inputs+1) * nn[i].N_Neurons; genes = new float[size]; }
/// <summary> /// GeneticLearningAlgorithm constructor /// </summary> /// <param name="nn">The neural network to train</param> public GeneticLearningAlgorithm(NeuralNetwork nn) : base(nn) { population = new List<GeneticNeuralNetwork>(); for(int i=0; i<POPULATION_SIZE; i++) population.Add(Muted_NeuralNetwork); }
/// <summary> /// Build a new BackPropagation learning algorithm instance /// with alpha = 0,5 and gamma = 0,3 /// </summary> /// <param name="nn">The neural network to train</param> public BackPropagationLearningAlgorithm(NeuralNetwork nn) : base(nn) { }
/// <summary> /// Learning algorithm constructor /// </summary> /// <param name="n">The neural network to train</param> public LearningAlgorithm(NeuralNetwork n) { nn = n; }