OpenNN::EvolutionaryAlgorithm Class Reference

#include <evolutionary_algorithm.h>

Inheritance diagram for OpenNN::EvolutionaryAlgorithm:

OpenNN::TrainingAlgorithm

List of all members.

Classes

struct  EvolutionaryAlgorithmResults

Public Types

enum  FitnessAssignmentMethod { LinearRanking }
enum  SelectionMethod { RouletteWheel, StochasticUniversalSampling }
enum  RecombinationMethod { Line, Intermediate }
enum  MutationMethod { Normal, Uniform }

Public Member Functions

 EvolutionaryAlgorithm (void)
 EvolutionaryAlgorithm (PerformanceFunctional *)
 EvolutionaryAlgorithm (TiXmlElement *)
virtual ~EvolutionaryAlgorithm (void)
const double & get_warning_parameters_norm (void) const
const double & get_error_parameters_norm (void) const
const double & get_minimum_parameters_increment_norm (void) const
const double & get_minimum_performance_increase (void) const
const double & get_performance_goal (void) const
const unsigned int & get_maximum_generalization_evaluation_decreases (void) const
const unsigned int & get_maximum_generations_number (void) const
const double & get_maximum_time (void) const
const bool & get_reserve_parameters_history (void) const
const bool & get_reserve_parameters_norm_history (void) const
const bool & get_reserve_evaluation_history (void) const
const bool & get_reserve_generalization_evaluation_history (void) const
const bool & get_reserve_elapsed_time_history (void) const
const unsigned int & get_display_period (void) const
unsigned int get_population_size (void) const
const Matrix< double > & get_population (void) const
const FitnessAssignmentMethodget_fitness_assignment_method (void) const
std::string write_fitness_assignment_method (void) const
const SelectionMethodget_selection_method (void) const
std::string write_selection_method (void) const
const RecombinationMethodget_recombination_method (void) const
std::string write_recombination_method (void) const
const MutationMethodget_mutation_method (void) const
std::string write_mutation_method (void) const
const Vector< double > & get_performance (void) const
const Vector< double > & get_fitness (void) const
const Vector< bool > & get_selection (void) const
const bool & get_elitism (void) const
const double & get_selective_pressure (void) const
const double & get_recombination_size (void) const
const double & get_mutation_rate (void) const
const double & get_mutation_range (void) const
const double & get_mean_performance_goal (void) const
const double & get_standard_deviation_performance_goal (void) const
const bool & get_reserve_population_history (void) const
const bool & get_reserve_best_individual_history (void) const
const bool & get_reserve_mean_norm_history (void) const
const bool & get_reserve_standard_deviation_norm_history (void) const
const bool & get_reserve_best_norm_history (void) const
const bool & get_reserve_mean_evaluation_history (void) const
const bool & get_reserve_standard_deviation_evaluation_history (void) const
const bool & get_reserve_best_evaluation_history (void) const
void set (void)
void set (PerformanceFunctional *)
void set_default (void)
void set_fitness_assignment_method (const FitnessAssignmentMethod &)
void set_fitness_assignment_method (const std::string &)
void set_selection_method (const SelectionMethod &)
void set_selection_method (const std::string &)
void set_recombination_method (const RecombinationMethod &)
void set_recombination_method (const std::string &)
void set_mutation_method (const MutationMethod &)
void set_mutation_method (const std::string &)
void set_population_size (const unsigned int &)
void set_population (const Matrix< double > &)
void set_performance (const Vector< double > &)
void set_fitness (const Vector< double > &)
void set_selection (const Vector< bool > &)
void set_elitism (const bool &)
void set_selective_pressure (const double &)
void set_recombination_size (const double &)
void set_mutation_rate (const double &)
void set_mutation_range (const double &)
void set_maximum_generations_number (const unsigned int &)
void set_mean_performance_goal (const double &)
void set_standard_deviation_performance_goal (const double &)
void set_reserve_population_history (const bool &)
void set_reserve_best_individual_history (const bool &)
void set_reserve_mean_norm_history (const bool &)
void set_reserve_standard_deviation_norm_history (const bool &)
void set_reserve_best_norm_history (const bool &)
void set_reserve_mean_evaluation_history (const bool &)
void set_reserve_standard_deviation_evaluation_history (const bool &)
void set_reserve_best_evaluation_history (const bool &)
void set_reserve_all_training_history (const bool &)
void set_warning_parameters_norm (const double &)
void set_error_parameters_norm (const double &)
void set_minimum_parameters_increment_norm (const double &)
void set_minimum_performance_increase (const double &)
void set_performance_goal (const double &)
void set_maximum_generalization_evaluation_decreases (const unsigned int &)
void set_maximum_time (const double &)
void set_reserve_parameters_history (const bool &)
void set_reserve_parameters_norm_history (const bool &)
void set_reserve_evaluation_history (const bool &)
void set_reserve_generalization_evaluation_history (const bool &)
void set_reserve_elapsed_time_history (const bool &)
void set_display_period (const unsigned int &)
Vector< double > get_individual (const unsigned int &) const
void set_individual (const unsigned int &, const Vector< double > &)
double calculate_mean_performance (void) const
double calculate_standard_deviation_performance (void) const
void initialize_population (const double &)
void initialize_population_uniform (void)
void initialize_population_uniform (const double &, const double &)
void initialize_population_uniform (const Vector< double > &, const Vector< double > &)
void initialize_population_normal (void)
void initialize_population_normal (const double &, const double &)
void initialize_population_normal (const Vector< double > &, const Vector< double > &)
Vector< double > calculate_population_norm (void) const
void perform_fitness_assignment (void)
void perform_selection (void)
void perform_recombination (void)
void perform_mutation (void)
void evolve_population (void)
void evaluate_population (void)
void perform_linear_ranking_fitness_assignment (void)
void perform_roulette_wheel_selection (void)
void perform_stochastic_universal_sampling_selection (void)
void perform_intermediate_recombination (void)
void perform_line_recombination (void)
void perform_normal_mutation (void)
void perform_uniform_mutation (void)
EvolutionaryAlgorithmResultsperform_training (void)
std::string write_training_algorithm_type (void) const
TiXmlElement * to_XML (void) const
void from_XML (TiXmlElement *)


Detailed Description

This concrete class represents an evolutionary training algorithm for a performance functional of a neural network.

Definition at line 31 of file evolutionary_algorithm.h.


Member Enumeration Documentation

Enumeration of the available training operators for fitness assignment.

Definition at line 40 of file evolutionary_algorithm.h.

Enumeration of the available training operators for selection.

Definition at line 44 of file evolutionary_algorithm.h.

Enumeration of the available training operators for recombination.

Definition at line 48 of file evolutionary_algorithm.h.

Enumeration of the available training operators for mutation.

Definition at line 52 of file evolutionary_algorithm.h.


Constructor & Destructor Documentation

OpenNN::EvolutionaryAlgorithm::EvolutionaryAlgorithm ( void   )  [explicit]

Default constructor. It creates a evolutionary training algorithm not associated to any performance functional. It also initializes the class members to their default values.

Definition at line 40 of file evolutionary_algorithm.cpp.

OpenNN::EvolutionaryAlgorithm::EvolutionaryAlgorithm ( PerformanceFunctional new_performance_functional_pointer  )  [explicit]

Performance functional constructor. It creates a evolutionary training algorithm associated to a performance functional. It also initializes the class members to their default values.

Parameters:
new_performance_functional_pointer Pointer to a performance functional object.

Definition at line 53 of file evolutionary_algorithm.cpp.

OpenNN::EvolutionaryAlgorithm::EvolutionaryAlgorithm ( TiXmlElement *  evolutionary_algorithm_element  )  [explicit]

XML constructor. It creates a evolutionary training algorithm not associated to any performance functional. It also loads the class members from a XML element.

Parameters:
evolutionary_algorithm_element Tiny XML element with the evolutionary algorithm object members.

Definition at line 67 of file evolutionary_algorithm.cpp.

OpenNN::EvolutionaryAlgorithm::~EvolutionaryAlgorithm ( void   )  [virtual]

Destructor.

Definition at line 78 of file evolutionary_algorithm.cpp.


Member Function Documentation

const double & OpenNN::EvolutionaryAlgorithm::get_warning_parameters_norm ( void   )  const

This method returns the minimum value for the norm of the parameters vector at wich a warning message is written to the screen.

Definition at line 315 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_error_parameters_norm ( void   )  const

This method returns the value for the norm of the parameters vector at wich an error message is written to the screen and the program exits.

Definition at line 326 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_minimum_parameters_increment_norm ( void   )  const

This method returns the minimum norm of the parameter increment vector used as a stopping criteria when training.

Definition at line 336 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_minimum_performance_increase ( void   )  const

This method returns the minimum performance improvement during training.

Definition at line 346 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_performance_goal ( void   )  const

This method returns the goal value for the performance. This is used as a stopping criterium when training a multilayer perceptron

Definition at line 357 of file evolutionary_algorithm.cpp.

const unsigned int & OpenNN::EvolutionaryAlgorithm::get_maximum_generalization_evaluation_decreases ( void   )  const

This method returns the maximum number of generalization failures during the training process.

Definition at line 367 of file evolutionary_algorithm.cpp.

const unsigned int & OpenNN::EvolutionaryAlgorithm::get_maximum_generations_number ( void   )  const

This method returns the maximum number of generations to train.

Definition at line 1690 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_maximum_time ( void   )  const

This method returns the maximum training time.

Definition at line 377 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_parameters_history ( void   )  const

This method returns true if the parameters history matrix is to be reserved, and false otherwise.

Definition at line 387 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_parameters_norm_history ( void   )  const

This method returns true if the parameters norm history vector is to be reserved, and false otherwise.

Definition at line 397 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_evaluation_history ( void   )  const

This method returns true if the evaluation history vector is to be reserved, and false otherwise.

Definition at line 407 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_generalization_evaluation_history ( void   )  const

This method returns true if the Generalization evaluation history vector is to be reserved, and false otherwise.

Definition at line 427 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_elapsed_time_history ( void   )  const

This method returns true if the elapsed time history vector is to be reserved, and false otherwise.

Definition at line 417 of file evolutionary_algorithm.cpp.

const unsigned int & OpenNN::EvolutionaryAlgorithm::get_display_period ( void   )  const

This method returns the number of epochs between the training showing progress.

Definition at line 437 of file evolutionary_algorithm.cpp.

unsigned int OpenNN::EvolutionaryAlgorithm::get_population_size ( void   )  const

This method returns the number of individuals in the population.

Definition at line 264 of file evolutionary_algorithm.cpp.

const Matrix< double > & OpenNN::EvolutionaryAlgorithm::get_population ( void   )  const

This method returns the population matrix.

Definition at line 274 of file evolutionary_algorithm.cpp.

const EvolutionaryAlgorithm::FitnessAssignmentMethod & OpenNN::EvolutionaryAlgorithm::get_fitness_assignment_method ( void   )  const

This method returns the fitness assignment method used for training.

Definition at line 90 of file evolutionary_algorithm.cpp.

std::string OpenNN::EvolutionaryAlgorithm::write_fitness_assignment_method ( void   )  const

This method returns a string with the name of the method used for fitness assignment.

Definition at line 100 of file evolutionary_algorithm.cpp.

const EvolutionaryAlgorithm::SelectionMethod & OpenNN::EvolutionaryAlgorithm::get_selection_method ( void   )  const

This method returns the selection method used for training.

Definition at line 129 of file evolutionary_algorithm.cpp.

std::string OpenNN::EvolutionaryAlgorithm::write_selection_method ( void   )  const

This method returns a string with the name of the method used for selection.

Definition at line 139 of file evolutionary_algorithm.cpp.

const EvolutionaryAlgorithm::RecombinationMethod & OpenNN::EvolutionaryAlgorithm::get_recombination_method ( void   )  const

This method returns the recombination method used for training.

Definition at line 174 of file evolutionary_algorithm.cpp.

std::string OpenNN::EvolutionaryAlgorithm::write_recombination_method ( void   )  const

This method returns a string with the name of the method used for recombination.

Definition at line 184 of file evolutionary_algorithm.cpp.

const EvolutionaryAlgorithm::MutationMethod & OpenNN::EvolutionaryAlgorithm::get_mutation_method ( void   )  const

This method returns the mutation method used for training.

Definition at line 219 of file evolutionary_algorithm.cpp.

std::string OpenNN::EvolutionaryAlgorithm::write_mutation_method ( void   )  const

This method returns a string with the name of the method used for mutation.

Definition at line 229 of file evolutionary_algorithm.cpp.

const Vector< double > & OpenNN::EvolutionaryAlgorithm::get_performance ( void   )  const

This method returns the actual performance value of all individuals in the population.

Definition at line 284 of file evolutionary_algorithm.cpp.

const Vector< double > & OpenNN::EvolutionaryAlgorithm::get_fitness ( void   )  const

This method returns the actual fitness value of all individuals in the population.

Definition at line 294 of file evolutionary_algorithm.cpp.

const Vector< bool > & OpenNN::EvolutionaryAlgorithm::get_selection ( void   )  const

This method returns the actual selection value of all individuals in the population.

Definition at line 304 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_elitism ( void   )  const

This method returns true if elitism is to be performed, and false otherwise.

Definition at line 1620 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_selective_pressure ( void   )  const

This method returns the selective pressure value.

Definition at line 1630 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_recombination_size ( void   )  const

This method returns the recombination size value.

Definition at line 1640 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_mutation_rate ( void   )  const

This method returns the mutation rate value.

Definition at line 1650 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_mutation_range ( void   )  const

This method returns the mutation range value.

Definition at line 1660 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_mean_performance_goal ( void   )  const

This method returns the mean performance value of the population at which training will stop.

Definition at line 1670 of file evolutionary_algorithm.cpp.

const double & OpenNN::EvolutionaryAlgorithm::get_standard_deviation_performance_goal ( void   )  const

This method returns the standard deviation of the performance at which training will stop.

Definition at line 1680 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_population_history ( void   )  const

This method returns true if the population history vector of matrices is to be reserved, and false otherwise.

Definition at line 448 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_best_individual_history ( void   )  const

This method returns true if the best individual history vector of vectors is to be reserved, and false otherwise.

Definition at line 458 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_mean_norm_history ( void   )  const

This method returns true if the mean population norm history vector is to be reserved, and false otherwise.

Definition at line 468 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_standard_deviation_norm_history ( void   )  const

This method returns true if the standard deviation of the population norm history vector is to be reserved, and false otherwise.

Definition at line 479 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_best_norm_history ( void   )  const

This method returns true if the norm of the best individual in the population history vector is to be reserved, and false otherwise.

Definition at line 490 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_mean_evaluation_history ( void   )  const

This method returns true if the mean evaluation history vector is to be reserved, and false otherwise.

Definition at line 500 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_standard_deviation_evaluation_history ( void   )  const

This method returns true if the standard deviation of the evaluation history vector is to be reserved, and false otherwise.

Definition at line 511 of file evolutionary_algorithm.cpp.

const bool & OpenNN::EvolutionaryAlgorithm::get_reserve_best_evaluation_history ( void   )  const

This method returns true if the best evaluation history vector is to be reserved, and false otherwise.

Definition at line 521 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set ( void   ) 

This method sets the performance functional pointer of this object to NULL. It also sets the rest of members to their default values.

Reimplemented from OpenNN::TrainingAlgorithm.

Definition at line 532 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set ( PerformanceFunctional new_performance_functional_pointer  ) 

This method sets a new performance functional pointer to the evolutionary algorithm object. It also sets the rest of members to their default values.

Reimplemented from OpenNN::TrainingAlgorithm.

Definition at line 545 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_default ( void   )  [virtual]

This method sets the members of the evolutionary algorithm object to their default values. Training operators:

  • Fitness assignment method: Linear ranking.
  • Selection method: Stochastic universal sampling.
  • Recombination method: Intermediate.
  • Mutation method: Normal.
Training parameters:
  • Population size: 10*parameters_number or 0.
  • Perform elitism: false.
  • Selective pressure: 1.5.
  • Recombination size: 0.25.
  • Mutation rate: = 1/parameters_number or 0.
  • Mutation range: = 0.1
Stopping criteria:
  • Performance goal: -1.0e99.
  • Mean performance goal: -1.0e99.
  • Standard deviation of performance goal: -1.0e99.
  • Maximum training time: 1.0e6.
  • Maximum number of generations: 100.
Training history:
  • Population = false.
  • Mean norm = false.
  • Standard deviation norm = false.
  • Best norm = false.
  • Mean performance = false.
  • Standard deviation performance = false.
  • Best performance = false.
User stuff:
  • Display: true.
  • Display period: 1.

Reimplemented from OpenNN::TrainingAlgorithm.

Definition at line 596 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_fitness_assignment_method ( const FitnessAssignmentMethod new_fitness_assignment_method  ) 

This method sets a new fitness assignment method to be used for training.

Parameters:
new_fitness_assignment_method Fitness assignment method chosen for training.

Definition at line 1904 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_fitness_assignment_method ( const std::string &  new_fitness_assignment_method_name  ) 

This method sets a new method for fitness assignment from a string containing the name. Possible values are:

  • "LinearRanking"
Parameters:
new_fitness_assignment_method_name String with name of method for fitness assignment.

Definition at line 788 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_selection_method ( const SelectionMethod new_selection_method  ) 

This method sets a new selection method to be used for training.

Parameters:
new_selection_method Selection method chosen for training.

Definition at line 1917 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_selection_method ( const std::string &  new_selection_method_name  ) 

This method sets a new method for selection from a string containing the name. Possible values are:

  • "LinearRanking"
  • "StochasticUniversalSampling"
Parameters:
new_selection_method_name String with name of method for selection.

Definition at line 817 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_recombination_method ( const RecombinationMethod new_recombination_method  ) 

This method sets a new recombination method to be used for training.

Parameters:
new_recombination_method Recombination method chosen for training.

Definition at line 1930 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_recombination_method ( const std::string &  new_recombination_method_name  ) 

This method sets a new method for recombination from a string containing the name. Possible values are:

  • "Line"
  • "Intermediate"
Parameters:
new_recombination_method_name String with name of method for recombination.

Definition at line 850 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_mutation_method ( const MutationMethod new_mutation_method  ) 

This method sets a new mutation method to be used for training.

Parameters:
new_mutation_method Mutation method chosen for training.

Definition at line 1942 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_mutation_method ( const std::string &  new_mutation_method_name  ) 

This method sets a new method for mutation from a string containing the name. Possible values are:

  • "Normal"
  • "Uniform"
Parameters:
new_mutation_method_name String with name of method for mutation.

Definition at line 883 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_population_size ( const unsigned int &  new_population_size  ) 

This method sets a new population with a new number of individuals. The new population size must be an even number equal or greater than four.

Parameters:
new_population_size Number of individuals in the population. This must be an even number equal or greater than four.

Definition at line 705 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_population ( const Matrix< double > &  new_population  ) 

This method sets a new population.

Parameters:
new_population Population Matrix.

Definition at line 912 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_performance ( const Vector< double > &  new_performance  ) 

This method sets a new population performance vector.

Parameters:
new_performance Population performance values.

Definition at line 980 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_fitness ( const Vector< double > &  new_fitness  ) 

This method sets a new population fitness vector.

Parameters:
new_fitness Population fitness values.

Definition at line 1013 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_selection ( const Vector< bool > &  new_selection  ) 

This method sets a new population selection vector.

Parameters:
new_selection Population selection values.

Definition at line 1046 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_elitism ( const bool &  new_elitism  ) 

This method sets a new elitism flag to the evolutionary algorithm. If elitism is set to true the best individual of each generation will be always selected for recombination.

Parameters:
new_elitism Elitism flag.

Definition at line 1702 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_selective_pressure ( const double &  new_selective_pressure  ) 

This method sets a new value for the selective pressure parameter. Linear ranking allows values for the selective pressure between 1 and 2.

Parameters:
new_selective_pressure Selective pressure value. This must be between 1 and 2 for linear ranking fitness assignment.

Definition at line 1716 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_recombination_size ( const double &  new_recombination_size  ) 

This method sets a new value for the recombination size parameter. The recombination size value must be equal or greater than 0.

Parameters:
new_recombination_size Recombination size value. This must be equal or greater than 0.

Definition at line 1750 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_mutation_rate ( const double &  new_mutation_rate  ) 

This method sets a new value for the mutation rate parameter. The mutation rate value must be between 0 and 1.

Parameters:
new_mutation_rate Mutation rate value. This value must lie in the interval [0,1].

Definition at line 1776 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_mutation_range ( const double &  new_mutation_range  ) 

This method sets a new value for the mutation range parameter. The mutation range value must be 0 or a positive number.

Parameters:
new_mutation_range Mutation range value. This must be equal or greater than 0.

Definition at line 1804 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_maximum_generations_number ( const unsigned int &  new_maximum_generations_number  ) 

This method sets a new value for the maximum number of generations to perform_training. The maximum number of generations value must be a positive number.

Parameters:
new_maximum_generations_number Maximum number of generations value.

Definition at line 1831 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_mean_performance_goal ( const double &  new_mean_performance_goal  ) 

This method sets a new value for the mean performance goal stopping criterium.

Parameters:
new_mean_performance_goal Goal value for the mean performance of the population.

Definition at line 1862 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_standard_deviation_performance_goal ( const double &  new_standard_deviation_performance_goal  ) 

This method sets a new value for the standard deviation performance goal stopping criterium.

Parameters:
new_standard_deviation_performance_goal Goal for the standard deviation performance of the population.

Definition at line 1873 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_population_history ( const bool &  new_reserve_population_history  ) 

This method makes the population history vector of matrices to be reseved or not in memory.

Parameters:
new_reserve_population_history True if the population history vector of matrices is to be reserved, false otherwise.

Definition at line 1079 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_best_individual_history ( const bool &  new_reserve_best_individual_history  ) 

This method makes the best individual history vector of vectors to be reseved or not in memory.

Parameters:
new_reserve_best_individual_history True if the best individual history vector of vectors is to be reserved, false otherwise.

Definition at line 1091 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_mean_norm_history ( const bool &  new_reserve_mean_norm_history  ) 

This method makes the mean norm history vector to be reseved or not in memory.

Parameters:
new_reserve_mean_norm_history True if the mean norm history vector is to be reserved, false otherwise.

Definition at line 1103 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_standard_deviation_norm_history ( const bool &  new_reserve_standard_deviation_norm_history  ) 

This method makes the standard deviation norm history vector to be reseved or not in memory.

Parameters:
new_reserve_standard_deviation_norm_history True if the standard deviation norm history vector is to be reserved, false otherwise.

Definition at line 1117 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_best_norm_history ( const bool &  new_reserve_best_norm_history  ) 

This method makes the best norm history vector to be reseved or not in memory.

Parameters:
new_reserve_best_norm_history True if the best norm history vector is to be reserved, false otherwise.

Definition at line 1129 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_mean_evaluation_history ( const bool &  new_reserve_mean_evaluation_history  ) 

This method makes the mean evaluation history vector to be reseved or not in memory.

Parameters:
new_reserve_mean_evaluation_history True if the mean evaluation history vector is to be reserved, false otherwise.

Definition at line 1142 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_standard_deviation_evaluation_history ( const bool &  new_reserve_standard_deviation_evaluation_history  ) 

This method makes the standard deviation evaluation history vector to be reseved or not in memory.

Parameters:
new_reserve_standard_deviation_evaluation_history True if the standard deviation evaluation history vector is to be reserved, false otherwise.

Definition at line 1156 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_best_evaluation_history ( const bool &  new_reserve_best_evaluation_history  ) 

This method makes the best evaluation history vector to be reseved or not in memory.

Parameters:
new_reserve_best_evaluation_history True if the best evaluation history vector is to be reserved, false otherwise.

Definition at line 1169 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_all_training_history ( const bool &  new_reserve_all_training_history  ) 

This method makes the training history of all variables to reseved or not in memory.

Parameters:
new_reserve_all_training_history True if the training history of all variables is to be reserved, false otherwise.

Definition at line 1182 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_warning_parameters_norm ( const double &  new_warning_parameters_norm  ) 

This method sets a new value for the parameters vector norm at which a warning message is written to the screen.

Parameters:
new_warning_parameters_norm Warning norm of parameters vector value.

Definition at line 1298 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_error_parameters_norm ( const double &  new_error_parameters_norm  ) 

This method sets a new value for the parameters vector norm at which an error message is written to the screen and the program exits.

Parameters:
new_error_parameters_norm Error norm of parameters vector value.

Definition at line 1329 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_minimum_parameters_increment_norm ( const double &  new_minimum_parameters_increment_norm  ) 

This method sets a new value for the minimum parameters increment norm stopping criterium.

Parameters:
new_minimum_parameters_increment_norm Value of norm of parameters increment norm used to stop training.

Definition at line 1359 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_minimum_performance_increase ( const double &  new_minimum_performance_increase  ) 

This method sets a new minimum performance improvement during training.

Parameters:
new_minimum_performance_increase Minimum improvement in the performance between two epochs.

Definition at line 1389 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_performance_goal ( const double &  new_performance_goal  ) 

This method sets a new goal value for the performance. This is used as a stopping criterium when training a multilayer perceptron

Parameters:
new_performance_goal Goal value for the performance.

Definition at line 1420 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_maximum_generalization_evaluation_decreases ( const unsigned int &  new_maximum_generalization_evaluation_decreases  ) 

This method sets a new maximum number of generalization failures.

Parameters:
new_maximum_generalization_evaluation_decreases Maximum number of epochs in which the generalization evalutation decreases.

Definition at line 1431 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_maximum_time ( const double &  new_maximum_time  ) 

This method sets a new maximum training time.

Parameters:
new_maximum_time Maximum training time.

Definition at line 1461 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_parameters_history ( const bool &  new_reserve_parameters_history  ) 

This method makes the parameters history vector of vectors to be reseved or not in memory.

Parameters:
new_reserve_parameters_history True if the parameters history vector of vectors is to be reserved, false otherwise.

Definition at line 1491 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_parameters_norm_history ( const bool &  new_reserve_parameters_norm_history  ) 

This method makes the parameters norm history vector to be reseved or not in memory.

Parameters:
new_reserve_parameters_norm_history True if the parameters norm history vector is to be reserved, false otherwise.

Definition at line 1502 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_evaluation_history ( const bool &  new_reserve_evaluation_history  ) 

This method makes the evaluation history vector to be reseved or not in memory.

Parameters:
new_reserve_evaluation_history True if the evaluation history vector is to be reserved, false otherwise.

Definition at line 1513 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_generalization_evaluation_history ( const bool &  new_reserve_generalization_evaluation_history  ) 

This method makes the Generalization evaluation history to be reserved or not in memory. This is a vector.

Parameters:
new_reserve_generalization_evaluation_history True if the Generalization evaluation history is to be reserved, false otherwise.

Definition at line 1537 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_reserve_elapsed_time_history ( const bool &  new_reserve_elapsed_time_history  ) 

This method makes the elapsed time over the epochs to be reseved or not in memory. This is a vector.

Parameters:
new_reserve_elapsed_time_history True if the elapsed time history vector is to be reserved, false otherwise.

Definition at line 1525 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_display_period ( const unsigned int &  new_display_period  ) 

This method sets a new number of epochs between the training showing progress.

Parameters:
new_display_period Number of epochs between the training showing progress.

Definition at line 1549 of file evolutionary_algorithm.cpp.

Vector< double > OpenNN::EvolutionaryAlgorithm::get_individual ( const unsigned int &  i  )  const

This method returns the Vector of parameters corresponding to the individual i in the population.

Parameters:
i Index of individual in the population.

Definition at line 1212 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::set_individual ( const unsigned int &  i,
const Vector< double > &  individual 
)

This method sets a new Vector of parameters to the individual i in the population.

Parameters:
i Index of individual in the population.
individual Vector of parameters to be assigned to individual i.

Definition at line 1249 of file evolutionary_algorithm.cpp.

double OpenNN::EvolutionaryAlgorithm::calculate_mean_performance ( void   )  const

This method returns the mean value of the individuals performance.

Definition at line 1598 of file evolutionary_algorithm.cpp.

double OpenNN::EvolutionaryAlgorithm::calculate_standard_deviation_performance ( void   )  const

This method returns the standard deviation value of the individuals performance.

Definition at line 1608 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::initialize_population ( const double &  new_value  ) 

This method initializes the population matrix with a given value.

Parameters:
new_value Initialization value.

Definition at line 1953 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::initialize_population_uniform ( void   ) 

This method initializes the parameters of all the individuals in the population at random, with values comprised between -1 and 1.

Definition at line 1965 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::initialize_population_uniform ( const double &  minimum,
const double &  maximum 
)

This method initializes the parameters of all the individuals in the population at random, with values comprised between a minimum and a maximum value.

Parameters:
minimum Minimum initialization value.
maximum Maximum initialization value.

Definition at line 1979 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::initialize_population_uniform ( const Vector< double > &  minimum,
const Vector< double > &  maximum 
)

This method initializes the parameters of all the individuals in the population at random, with values comprised between different minimum and maximum values for each variable.

Parameters:
minimum Vector of minimum initialization values.
maximum Vector of maximum initialization values.

Definition at line 1993 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::initialize_population_normal ( void   ) 

This method initializes the parameters of all the individuals in the population with random values chosen from a normal distribution with mean 0 and standard deviation 1.

Definition at line 2037 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::initialize_population_normal ( const double &  mean,
const double &  standard_deviation 
)

This method initializes the parameters of all the individuals in the population with random values chosen from a normal distribution with a given mean and a given standard deviation.

Parameters:
mean Mean of normal distribution.
standard_deviation Standard deviation of normal distribution.

Definition at line 2051 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::initialize_population_normal ( const Vector< double > &  mean,
const Vector< double > &  standard_deviation 
)

This method initializes the parameters of all the individuals in the population with random values chosen from normal distributions with different mean and standard deviation for each free parameter.

Parameters:
mean Vector of mean values.
standard_deviation Vector of standard deviation values.

Definition at line 2066 of file evolutionary_algorithm.cpp.

Vector< double > OpenNN::EvolutionaryAlgorithm::calculate_population_norm ( void   )  const

This method returns a vector containing the norm of each individual in the population.

Definition at line 1577 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_fitness_assignment ( void   ) 

This method assigns a fitness value to all the individuals in the population according to the finess assignment operator.

Definition at line 2109 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_selection ( void   ) 

This method selects for recombination some individuals from the population according to the selection operator.

Definition at line 2139 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_recombination ( void   ) 

This method recombinates the selected individuals according to the recombination operator.

Definition at line 2174 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_mutation ( void   ) 

This method mutates the population matrix according to the mutation operator.

Definition at line 2209 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::evolve_population ( void   ) 

This method generates a new population matrix by applying fitness assignment, selection, recombination and mutation.

Definition at line 2244 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::evaluate_population ( void   ) 

This method evaluates the performance functional of all individuals in the population. Results are stored in the performance vector.

Definition at line 2269 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_linear_ranking_fitness_assignment ( void   ) 

This method ranks all individuals in the population by their objective performance, so that the least fit individual has rank 1 and the fittest individual has rank [population size]. It then assigns them a fitness value linearly proportional to their rank. Results are stored in the fitness vector.

Definition at line 2344 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_roulette_wheel_selection ( void   ) 

This metod performs selection with roulette wheel selection. It selects half of the individuals from the population. Results are stored in the selection vector.

Definition at line 2398 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_stochastic_universal_sampling_selection ( void   ) 

This metod performs selection with stochastic universal sampling. It selects half of the individuals from the population. Results are stored in the selection vector.

Definition at line 2485 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_intermediate_recombination ( void   ) 

This method performs inediate recombination between pairs of selected individuals to generate a new population. Each selected individual is to be recombined with two other selected individuals chosen at random. Results are stored in the population matrix.

Definition at line 2577 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_line_recombination ( void   ) 

This method performs line recombination between pairs of selected individuals to generate a new population. Each selected individual is to be recombined with two other selected individuals chosen at random. Results are stored in the population matrix.

Definition at line 2691 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_normal_mutation ( void   ) 

This method performs normal mutation to all individuals in order to generate a new population. Results are stored in the population matrix.

Definition at line 2801 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::perform_uniform_mutation ( void   ) 

This method performs uniform mutation to all individuals in order to generate a new population. Results are stored in the population matrix.

Definition at line 2837 of file evolutionary_algorithm.cpp.

EvolutionaryAlgorithm::EvolutionaryAlgorithmResults * OpenNN::EvolutionaryAlgorithm::perform_training ( void   )  [virtual]

This method trains a neural network with an associated performance function according to the evolutionary algorithm. Training occurs according to the training operators and their related parameters.

Todo:

Implements OpenNN::TrainingAlgorithm.

Definition at line 3037 of file evolutionary_algorithm.cpp.

std::string OpenNN::EvolutionaryAlgorithm::write_training_algorithm_type ( void   )  const [virtual]

This method writes a string with the type of training algoritm.

Reimplemented from OpenNN::TrainingAlgorithm.

Definition at line 3401 of file evolutionary_algorithm.cpp.

TiXmlElement * OpenNN::EvolutionaryAlgorithm::to_XML ( void   )  const [virtual]

This method prints to the screen the members of the evolutionary algorithm object.

Training operators:

  • Fitness assignment method.
  • Selection method.
  • Recombination method.
  • Mutation method.

Training parameters:

  • Population size.
  • Selective pressure.
  • Recombination size.
  • Mutation rate.
  • Mutation range.

Stopping criteria:

  • Performance goal.
  • Mean performance goal.
  • Standard deviation of performance goal.
  • Maximum time.
  • Maximum number of generations.

User stuff:

  • Display.
  • Display period.
  • Reserve elapsed time.
  • Reserve mean norm history.
  • Reserve standard deviation of norm history.
  • Reserve best norm history.
  • Reserve mean evaluation history.
  • Reserve standard deviation of evaluation history.
  • Reserve best evaluation history.

Population matrix.

Reimplemented from OpenNN::TrainingAlgorithm.

Definition at line 3452 of file evolutionary_algorithm.cpp.

void OpenNN::EvolutionaryAlgorithm::from_XML ( TiXmlElement *  evolutionary_algorithm_element  )  [virtual]

This method loads a evolutionary algorithm object from a XML element. Please mind about the file format, wich is specified in the User's Guide.

Parameters:
evolutionary_algorithm_element Tiny XML element with the evolutionary algorithm object members.

Reimplemented from OpenNN::TrainingAlgorithm.

Definition at line 3614 of file evolutionary_algorithm.cpp.


The documentation for this class was generated from the following files:

Generated on Sun Aug 26 11:58:20 2012 for OpenNN by  doxygen 1.5.9