AForge.Neuro.Learning.EvolutionaryLearning.EvolutionaryLearning C# (CSharp) Method

EvolutionaryLearning() public method

Initializes a new instance of the EvolutionaryLearning class.

This version of constructor is used to create genetic population for searching optimal neural network's weight using default set of parameters, which are: Selection method - elite; Crossover rate - 0.75; Mutation rate - 0.25; Rate of injection of random chromosomes during selection - 0.20; Random numbers generator for initializing new chromosome - UniformGenerator( new Range( -1, 1 ) ); Random numbers generator used during mutation for genes' multiplication - ExponentialGenerator( 1 ); Random numbers generator used during mutation for adding random value to genes - UniformGenerator( new Range( -0.5f, 0.5f ) ).

In order to have full control over the above default parameters, it is possible to used extended version of constructor, which allows to specify all of the parameters.

public EvolutionaryLearning ( ActivationNetwork activationNetwork, int populationSize ) : System
activationNetwork ActivationNetwork Activation network to be trained.
populationSize int Size of genetic population.
return System
        public EvolutionaryLearning( ActivationNetwork activationNetwork, int populationSize )
        {
            // Check of assumptions during debugging only
            Debug.Assert( activationNetwork != null );
            Debug.Assert( populationSize > 0 );

            // networks's parameters
            this.network = activationNetwork;
            this.numberOfNetworksWeights = CalculateNetworkSize( activationNetwork );

            // population parameters
            this.populationSize = populationSize;
            this.chromosomeGenerator = new UniformGenerator( new Range( -1, 1 ) );
            this.mutationMultiplierGenerator = new ExponentialGenerator( 1 );
            this.mutationAdditionGenerator = new UniformGenerator( new Range( -0.5f, 0.5f ) );
            this.selectionMethod = new EliteSelection( );
            this.crossOverRate = 0.75;
            this.mutationRate = 0.25;
            this.randomSelectionRate = 0.2;
        }

Same methods

EvolutionaryLearning::EvolutionaryLearning ( ActivationNetwork activationNetwork, int populationSize, IRandomNumberGenerator chromosomeGenerator, IRandomNumberGenerator mutationMultiplierGenerator, IRandomNumberGenerator mutationAdditionGenerator, ISelectionMethod selectionMethod, double crossOverRate, double mutationRate, double randomSelectionRate ) : System