Flood::TrainingAlgorithm Class Reference

#include <TrainingAlgorithm.h>

Inheritance diagram for Flood::TrainingAlgorithm:

Flood::ConjugateGradient Flood::EvolutionaryAlgorithm Flood::GradientDescent Flood::NewtonMethod Flood::QuasiNewtonMethod Flood::RandomSearch

List of all members.

Public Types

enum  TrainingRateMethod { Fixed, GoldenSection, BrentMethod }

Public Member Functions

 TrainingAlgorithm (ObjectiveFunctional *)
 TrainingAlgorithm (void)
virtual ~TrainingAlgorithm (void)
ObjectiveFunctionalget_objective_functional_pointer (void)
TrainingAlgorithm::TrainingRateMethod get_training_rate_method (void)
std::string get_training_rate_method_name (void)
double get_first_training_rate (void)
double get_bracketing_factor (void)
double get_training_rate_tolerance (void)
double get_warning_parameters_norm (void)
double get_warning_gradient_norm (void)
double get_warning_training_rate (void)
double get_error_parameters_norm (void)
double get_error_gradient_norm (void)
double get_error_training_rate (void)
double get_minimum_parameters_increment_norm (void)
double get_minimum_evaluation_improvement (void)
double get_evaluation_goal (void)
double get_gradient_norm_goal (void)
int get_maximum_epochs_number (void)
double get_maximum_time (void)
bool get_early_stopping (void)
bool get_reserve_parameters_history (void)
bool get_reserve_parameters_norm_history (void)
bool get_reserve_evaluation_history (void)
bool get_reserve_gradient_history (void)
bool get_reserve_gradient_norm_history (void)
bool get_reserve_inverse_Hessian_history (void)
bool get_reserve_validation_error_history (void)
bool get_reserve_training_direction_history (void)
bool get_reserve_training_rate_history (void)
bool get_reserve_elapsed_time_history (void)
Vector< Vector< double > > & get_parameters_history (void)
Vector< double > & get_parameters_norm_history (void)
Vector< double > & get_evaluation_history (void)
Vector< Vector< double > > & get_gradient_history (void)
Vector< double > & get_gradient_norm_history (void)
Vector< Matrix< double > > & get_inverse_Hessian_history (void)
Vector< double > & get_validation_error_history (void)
Vector< Vector< double > > & get_training_direction_history (void)
Vector< double > & get_training_rate_history (void)
Vector< double > & get_elapsed_time_history (void)
bool get_display (void)
int get_display_period (void)
void set (void)
void set (ObjectiveFunctional *)
virtual void set_default (void)
void set_objective_functional_pointer (ObjectiveFunctional *)
void set_training_rate_method (const TrainingRateMethod &)
void set_training_rate_method (const std::string &)
void set_first_training_rate (double)
void set_bracketing_factor (double)
void set_training_rate_tolerance (double)
void set_warning_parameters_norm (double)
void set_warning_gradient_norm (double)
void set_warning_training_rate (double)
void set_error_parameters_norm (double)
void set_error_gradient_norm (double)
void set_error_training_rate (double)
void set_minimum_parameters_increment_norm (double)
void set_minimum_evaluation_improvement (double)
void set_evaluation_goal (double)
void set_gradient_norm_goal (double)
void set_maximum_epochs_number (int)
void set_maximum_time (double)
void set_early_stopping (bool)
void set_reserve_parameters_history (bool)
void set_reserve_parameters_norm_history (bool)
void set_reserve_evaluation_history (bool)
void set_reserve_gradient_history (bool)
void set_reserve_gradient_norm_history (bool)
void set_reserve_inverse_Hessian_history (bool)
void set_reserve_validation_error_history (bool)
void set_reserve_training_direction_history (bool)
void set_reserve_training_rate_history (bool)
void set_reserve_elapsed_time_history (bool)
virtual void set_reserve_all_training_history (bool)
void set_parameters_history (const Vector< Vector< double > > &)
void set_parameters_norm_history (const Vector< double > &)
void set_evaluation_history (const Vector< double > &)
void set_gradient_history (const Vector< Vector< double > > &)
void set_gradient_norm_history (const Vector< double > &)
void set_inverse_Hessian_history (const Vector< Matrix< double > > &)
void set_training_direction_history (const Vector< Vector< double > > &)
void set_training_rate_history (const Vector< double > &)
void set_elapsed_time_history (const Vector< double > &)
void set_validation_error_history (const Vector< double > &)
void set_display (bool)
void set_display_period (int)
virtual void train (void)=0
Vector< double > calculate_training_rate_evaluation (double, const Vector< double > &, double)
Vector< double > calculate_fixed_training_rate_evaluation (double, const Vector< double > &, double)
Vector< double > calculate_golden_section_training_rate_evaluation (double, const Vector< double > &, double)
Vector< double > calculate_Brent_method_training_rate_evaluation (double, const Vector< double > &, double)
Vector< double > calculate_bracketing_training_rate_evaluation (double, const Vector< double > &, double)
virtual void resize_training_history (int)
virtual std::string get_training_history_XML (bool)
void print_training_history (void)
void save_training_history (const char *)
virtual std::string to_XML (bool)
void print (void)
void save (const char *)
virtual void load (const char *)

Protected Attributes

ObjectiveFunctionalobjective_functional_pointer
TrainingRateMethod training_rate_method
double bracketing_factor
double first_training_rate
double training_rate_tolerance
double warning_parameters_norm
double warning_gradient_norm
double warning_training_rate
double error_parameters_norm
double error_gradient_norm
double error_training_rate
double minimum_parameters_increment_norm
double minimum_evaluation_improvement
double evaluation_goal
double gradient_norm_goal
int maximum_epochs_number
double maximum_time
bool early_stopping
bool reserve_parameters_history
bool reserve_parameters_norm_history
bool reserve_evaluation_history
bool reserve_gradient_history
bool reserve_gradient_norm_history
bool reserve_inverse_Hessian_history
bool reserve_training_direction_history
bool reserve_training_rate_history
bool reserve_elapsed_time_history
bool reserve_validation_error_history
Vector< Vector< double > > parameters_history
Vector< double > parameters_norm_history
Vector< double > evaluation_history
Vector< Vector< double > > gradient_history
Vector< double > gradient_norm_history
Vector< Matrix< double > > inverse_Hessian_history
Vector< Vector< double > > training_direction_history
Vector< double > training_rate_history
Vector< double > elapsed_time_history
Vector< double > validation_error_history
bool display
int display_period


Detailed Description

This abstract class represents the concept of training algorithm for the multilayer perceptron. Any derived class must implement the train(void), print(void) and save(const char*) methods.

Definition at line 31 of file TrainingAlgorithm.h.


Member Enumeration Documentation

Available training operators for obtaining the train rate.

Definition at line 40 of file TrainingAlgorithm.h.


Constructor & Destructor Documentation

Flood::TrainingAlgorithm::TrainingAlgorithm ( ObjectiveFunctional new_objective_functional_pointer  )  [explicit]

General constructor. It creates a training algorithm object associated to an objective functional object.

Parameters:
new_objective_functional_pointer Pointer to an objective functional object.

Definition at line 34 of file TrainingAlgorithm.cpp.

Flood::TrainingAlgorithm::TrainingAlgorithm ( void   )  [explicit]

Default constructor. It creates a training algorithm object not associated to any objective functional object.

Definition at line 46 of file TrainingAlgorithm.cpp.

Flood::TrainingAlgorithm::~TrainingAlgorithm ( void   )  [virtual]

Destructor.

Definition at line 58 of file TrainingAlgorithm.cpp.


Member Function Documentation

Vector< double > Flood::TrainingAlgorithm::calculate_bracketing_training_rate_evaluation ( double  evaluation,
const Vector< double > &  training_direction,
double  initial_training_rate 
)

This method returns a vector with two elements, a bracketing training rate for the optimum, and the evaluation for that training rate. This algorithm is used by line minimization algorithms.

Parameters:
evaluation Initial objective function evaluation.
training_direction Initial training direction.
initial_training_rate Initial training rate to start the algorithm.

Definition at line 1416 of file TrainingAlgorithm.cpp.

Vector< double > Flood::TrainingAlgorithm::calculate_Brent_method_training_rate_evaluation ( double  evaluation,
const Vector< double > &  training_direction,
double  initial_training_rate 
)

This method returns the training rate by searching in a given direction to locate the minimum of the evaluation function in that direction. It uses the Brent's method.

Parameters:
evaluation Neural network's evaluation value.
training_direction Training direction vector.
initial_training_rate Initial training rate in line minimization.

Definition at line 1684 of file TrainingAlgorithm.cpp.

Vector< double > Flood::TrainingAlgorithm::calculate_fixed_training_rate_evaluation ( double  ,
const Vector< double > &  training_direction,
double   
)

This method returns a vector with two elements, a fixed training rate equal to the first training rate object member, and the evaluation for that training rate.

Parameters:
training_direction Initial training direction.

Definition at line 1492 of file TrainingAlgorithm.cpp.

Vector< double > Flood::TrainingAlgorithm::calculate_golden_section_training_rate_evaluation ( double  evaluation,
const Vector< double > &  training_direction,
double  initial_training_rate 
)

This method returns the training rate by searching in a given direction to locate the minimum of the objective function in that direction. It uses the golden section method.

Parameters:
evaluation Neural network's evaluation value.
training_direction Training direction vector.
initial_training_rate Initial training rate in line minimization.

Definition at line 1523 of file TrainingAlgorithm.cpp.

Vector< double > Flood::TrainingAlgorithm::calculate_training_rate_evaluation ( double  evaluation,
const Vector< double > &  training_direction,
double  initial_training_rate 
)

This method returns a vector with two elements, the training rate calculated by means of the training rate object member, and the evaluation for that training rate.

Parameters:
evaluation Initial objective function evaluation.
training_direction Initial training direction.
initial_training_rate Initial training rate to start the algorithm.

Definition at line 1368 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_bracketing_factor ( void   ) 

This method returns the increase factor when bracketing a minimum in line minimization.

Definition at line 139 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_display ( void   ) 

This method returns true if messages from this class can be displayed on the screen, or false if messages from this class can't be displayed on the screen.

Definition at line 500 of file TrainingAlgorithm.cpp.

int Flood::TrainingAlgorithm::get_display_period ( void   ) 

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

Definition at line 489 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_early_stopping ( void   ) 

This method returns true if early stopping is to be performed during training, and false otherwise.

Definition at line 287 of file TrainingAlgorithm.cpp.

Vector< double > & Flood::TrainingAlgorithm::get_elapsed_time_history ( void   ) 

This method returns a matrix containing the elapsed time history over the training epochs.

Definition at line 471 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_error_gradient_norm ( void   ) 

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

Definition at line 204 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_error_parameters_norm ( void   ) 

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 193 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_error_training_rate ( void   ) 

This method returns the training rate value at wich the line minimization algorithm is assumed to fail when bracketing a minimum.

Definition at line 215 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_evaluation_goal ( void   ) 

This method returns the goal value for the evaluation. This is used as a stopping criterium when training a neural network.

Definition at line 246 of file TrainingAlgorithm.cpp.

Vector< double > & Flood::TrainingAlgorithm::get_evaluation_history ( void   ) 

This method returns a vector containing the evaluations history over the training epochs.

Definition at line 413 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_first_training_rate ( void   ) 

This method returns the initial training rate value in line minimization.

Definition at line 129 of file TrainingAlgorithm.cpp.

Vector< Vector< double > > & Flood::TrainingAlgorithm::get_gradient_history ( void   ) 

This method returns a matrix containing the gradient history over the training epochs.

Definition at line 423 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_gradient_norm_goal ( void   ) 

This method returns the goal value for the norm of the objective function gradient. This is used as a stopping criterium when training a neural network.

Definition at line 257 of file TrainingAlgorithm.cpp.

Vector< double > & Flood::TrainingAlgorithm::get_gradient_norm_history ( void   ) 

This method returns a vector containing the gradient norm history over the training epochs.

Definition at line 433 of file TrainingAlgorithm.cpp.

int Flood::TrainingAlgorithm::get_maximum_epochs_number ( void   ) 

This method returns the maximum number of epochs for training.

Definition at line 267 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_maximum_time ( void   ) 

This method returns the maximum training time.

Definition at line 277 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_minimum_evaluation_improvement ( void   ) 

This method returns the minimum evaluation improvement during training.

Definition at line 235 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_minimum_parameters_increment_norm ( void   ) 

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

Definition at line 225 of file TrainingAlgorithm.cpp.

ObjectiveFunctional * Flood::TrainingAlgorithm::get_objective_functional_pointer ( void   ) 

This method returns a pointer to the objective functional object to which the training algorithm is associated.

Definition at line 70 of file TrainingAlgorithm.cpp.

Vector< Vector< double > > & Flood::TrainingAlgorithm::get_parameters_history ( void   ) 

This method returns a matrix containing the parameters history over the training epochs.

Definition at line 393 of file TrainingAlgorithm.cpp.

Vector< double > & Flood::TrainingAlgorithm::get_parameters_norm_history ( void   ) 

This method returns a vector containing the parameters norm history over the training epochs.

Definition at line 403 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_reserve_elapsed_time_history ( void   ) 

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

Definition at line 375 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_reserve_evaluation_history ( void   ) 

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

Definition at line 317 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_reserve_gradient_history ( void   ) 

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

Definition at line 327 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_reserve_gradient_norm_history ( void   ) 

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

Definition at line 337 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_reserve_parameters_history ( void   ) 

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

Definition at line 297 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_reserve_parameters_norm_history ( void   ) 

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

Definition at line 307 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_reserve_training_direction_history ( void   ) 

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

Definition at line 355 of file TrainingAlgorithm.cpp.

bool Flood::TrainingAlgorithm::get_reserve_training_rate_history ( void   ) 

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

Definition at line 365 of file TrainingAlgorithm.cpp.

Vector< Vector< double > > & Flood::TrainingAlgorithm::get_training_direction_history ( void   ) 

This method returns the training direction history matrix.

Definition at line 451 of file TrainingAlgorithm.cpp.

std::string Flood::TrainingAlgorithm::get_training_history_XML ( bool  show_declaration  )  [virtual]

This method returns a string with the history of the training process in XML-type format. Only that training history variables which have been reserved are included here.

Parameters:
show_declaration True if an XML-type declaration is to be included at the beginning.

Reimplemented in Flood::ConjugateGradient, Flood::EvolutionaryAlgorithm, Flood::GradientDescent, Flood::NewtonMethod, Flood::QuasiNewtonMethod, and Flood::RandomSearch.

Definition at line 2876 of file TrainingAlgorithm.cpp.

Vector< double > & Flood::TrainingAlgorithm::get_training_rate_history ( void   ) 

This method returns the training rate history vector.

Definition at line 461 of file TrainingAlgorithm.cpp.

TrainingAlgorithm::TrainingRateMethod Flood::TrainingAlgorithm::get_training_rate_method ( void   ) 

This method returns the training rate method used for training.

Definition at line 80 of file TrainingAlgorithm.cpp.

std::string Flood::TrainingAlgorithm::get_training_rate_method_name ( void   ) 

This method returns a string with the name of the training rate method to be used.

Definition at line 90 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_training_rate_tolerance ( void   ) 

This method returns the tolerance value in line minimization.

Definition at line 149 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_warning_gradient_norm ( void   ) 

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

Definition at line 171 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_warning_parameters_norm ( void   ) 

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 160 of file TrainingAlgorithm.cpp.

double Flood::TrainingAlgorithm::get_warning_training_rate ( void   ) 

This method returns the training rate value at wich a warning message is written to the screen during line minimization.

Definition at line 182 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::load ( const char *  filename  )  [virtual]

This method loads a gradient descent object from a XML-type file. Please mind about the file format, wich is specified in the User's Guide.

Parameters:
filename Name of training algorithm XML-type file.

Reimplemented in Flood::ConjugateGradient, Flood::EvolutionaryAlgorithm, Flood::GradientDescent, Flood::NewtonMethod, Flood::QuasiNewtonMethod, and Flood::RandomSearch.

Definition at line 2145 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::print ( void   ) 

This method prints to the screen the XML-type representation of the training algorithm object.

Definition at line 2103 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::print_training_history ( void   ) 

This method prints to the screen the history of the training process for the reserved variables.

Definition at line 2980 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::resize_training_history ( int  new_size  )  [virtual]

This method resizes all the default training history vectors.

Parameters:
new_size Size vectors containing the training history variables.

Reimplemented in Flood::ConjugateGradient, Flood::EvolutionaryAlgorithm, Flood::GradientDescent, Flood::NewtonMethod, Flood::QuasiNewtonMethod, and Flood::RandomSearch.

Definition at line 2810 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::save ( const char *  filename  ) 

This method saves to a XML-type file the members of the training algorithm object.

Parameters:
filename Name of training algorithm XML-type file.

Definition at line 2114 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::save_training_history ( const char *  filename  ) 

This method saves the training history to a XML-type file.

Parameters:
filename Training history XML-type filename.

Definition at line 2991 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set ( ObjectiveFunctional new_objective_functional_pointer  ) 

This method sets a new objective functional pointer. It also sets the rest of members to their default values.

Parameters:
new_objective_functional_pointer Pointer to an objective functional object.

Reimplemented in Flood::EvolutionaryAlgorithm.

Definition at line 524 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set ( void   ) 

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

Reimplemented in Flood::EvolutionaryAlgorithm.

Definition at line 511 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_bracketing_factor ( double  new_bracketing_factor  ) 

This method sets a new increase factor value to be used for line minimization when bracketing a minimum.

Parameters:
new_bracketing_factor Bracketing factor value.

Definition at line 706 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_default ( void   )  [virtual]

This method sets the members of the training algorithm object to their default values:

  • Training rate method: Brent method
  • Bracketing factor: 1.5
  • First training rate: 1.0e-2
  • Training rate tolerance: 1.0e-3
  • Warning parameters norm: 1.0e6
  • Warning gradient norm: 1.0e6
  • Warning training rate: 1.0e6
  • Error parameters norm: 1.0e9
  • Error gradient norm: 1.0e9
  • Error training rate: 1.0e9
  • Minimum parameters increment norm: 0.0
  • Minimum evaluation improvement: 0.0
  • Evaluation goal: -Inf
  • Gradient norm goal: 0.0
  • Early stopping: False
  • Maximum epochs number: 1000
  • Maximum time: 1000
  • Reserve parameters history: False
  • Reserve parameters norm history: False
  • Reserve evaluation history: False
  • Reserve gradient history: False
  • Reserve gradient norm history: False
  • Reserve inverse Hessian history: False
  • Reserve validation error history: False
  • Reserve training direction history: False
  • Reserve training direction norm history: False
  • Reserve training rate history: False
  • Reserve elapsed time history: False
  • Display: True
  • Display period: 100

Reimplemented in Flood::EvolutionaryAlgorithm, and Flood::RandomSearch.

Definition at line 567 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_display ( bool  new_display  ) 

This method sets a new display value. If it is set to true messages from this class are to be displayed on the screen; if it is set to false messages from this class are not to be displayed on the screen.

Parameters:
new_display Display value.

Definition at line 1353 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_display_period ( 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 1325 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_early_stopping ( bool  new_early_stopping  ) 

This method activates or not early stopping in the training process.

Parameters:
new_early_stopping True if early stopping is to be performed, false otherwise.

Definition at line 1085 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_elapsed_time_history ( const Vector< double > &  new_elapsed_time_history  ) 

This method sets a new elapsed time history vector. The elements in the vector are the measured times over the training epochs.

Parameters:
new_elapsed_time_history Elapsed time history vector.

Definition at line 1313 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_error_gradient_norm ( double  new_error_gradient_norm  ) 

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

Parameters:
new_error_gradient_norm Error norm of gradient vector value.

Definition at line 875 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_error_parameters_norm ( 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 846 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_error_training_rate ( double  new_error_training_rate  ) 

This method sets a new training rate value at wich a the line minimization algorithm is assumed to fail when bracketing a minimum.

Parameters:
new_error_training_rate Error training rate value.

Definition at line 904 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_evaluation_goal ( double  new_evaluation_goal  ) 

This method sets a new goal value for the evaluation. This is used as a stopping criterium when training a neural network.

Parameters:
new_evaluation_goal Goal value for the evaluation.

Definition at line 989 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_evaluation_history ( const Vector< double > &  new_evaluation_history  ) 

This method sets a new vector containing the evaluation history over the training epochs. Each row in the matrix contains the parameters vector of one single epoch.

Parameters:
new_evaluation_history Evaluation history vector.

Definition at line 1240 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_first_training_rate ( double  new_first_training_rate  ) 

This method sets a new value to be used as an initial training rate in line minimization.

Parameters:
new_first_training_rate Initial training rate value.

Definition at line 678 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_gradient_history ( const Vector< Vector< double > > &  new_gradient_history  ) 

This method sets a new gradient history matrix over the training epochs. The number of rows must be equal to the training size. The number of columns must be equal to the number of parameters.

Parameters:
new_gradient_history Gradient history matrix.

Definition at line 1253 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_gradient_norm_goal ( double  new_gradient_norm_goal  ) 

This method sets a new the goal value for the norm of the objective function gradient. This is used as a stopping criterium when training a neural network.

Parameters:
new_gradient_norm_goal Goal value for the norm of the objective function gradient.

Definition at line 1001 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_gradient_norm_history ( const Vector< double > &  new_gradient_norm_history  ) 

This method sets a new gradient norm history vector. The elements in the vector are the gradient norm values over the training epochs.

Parameters:
new_gradient_norm_history Gradient norm history vector.

Definition at line 1265 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_inverse_Hessian_history ( const Vector< Matrix< double > > &  new_inverse_Hessian_history  ) 

This method sets a new history of the inverse Hessian over the epochs from a vector of matrices.

Parameters:
new_inverse_Hessian_history History of the inverse Hessian matrix.

Definition at line 1276 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_maximum_epochs_number ( int  new_maximum_epochs_number  ) 

This method sets a maximum number of epochs for training.

Parameters:
new_maximum_epochs_number Maximum number of epochs for training.

Definition at line 1029 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_maximum_time ( double  new_maximum_time  ) 

This method sets a new maximum training time.

Parameters:
new_maximum_time Maximum training time.

Definition at line 1057 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_minimum_evaluation_improvement ( double  new_minimum_evaluation_improvement  ) 

This method sets a new minimum evaluation improvement during training.

Parameters:
new_minimum_evaluation_improvement Minimum improvement in the evaluation between two epochs.

Definition at line 960 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_minimum_parameters_increment_norm ( 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 932 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_objective_functional_pointer ( ObjectiveFunctional new_objective_functional_pointer  ) 

This method sets a pointer to an objective functional object to be associated to the training algorithm.

Parameters:
new_objective_functional_pointer Pointer to an objective functional object.

Definition at line 626 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_parameters_history ( const Vector< Vector< double > > &  new_parameters_history  ) 

This method sets a new vector of vectors containing the parameters history over the training epochs. Each element in the vector contains the parameters of a single epoch.

Parameters:
new_parameters_history Free parameters history vector of vectors.

Definition at line 1215 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_parameters_norm_history ( const Vector< double > &  new_parameters_norm_history  ) 

This method sets a new matrix containing the parameters norm history over the training epochs. Each element in the vector contains the parameters norm of one single epoch.

Parameters:
new_parameters_norm_history Free parameters norm history vector.

Definition at line 1228 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_all_training_history ( bool  new_reserve_all_training_history  )  [virtual]

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

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

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

Reimplemented in Flood::ConjugateGradient, Flood::EvolutionaryAlgorithm, Flood::GradientDescent, Flood::NewtonMethod, Flood::QuasiNewtonMethod, and Flood::RandomSearch.

Definition at line 2787 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_elapsed_time_history ( 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 1191 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_evaluation_history ( 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 1120 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_gradient_history ( bool  new_reserve_gradient_history  ) 

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

Parameters:
new_reserve_gradient_history True if the gradient history matrix is to be reserved, false otherwise.

Definition at line 1131 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_gradient_norm_history ( bool  new_reserve_gradient_norm_history  ) 

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

Parameters:
new_reserve_gradient_norm_history True if the gradient norm history matrix is to be reserved, false otherwise.

Definition at line 1143 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_inverse_Hessian_history ( bool  new_reserve_inverse_Hessian_history  ) 

This method sets the history of the inverse of the Hessian matrix to be reserved or not in memory. This is a vector of matrices.

Parameters:
new_reserve_inverse_Hessian_history True if the inverse Hessian history is to be reserved, false otherwise.

Definition at line 1155 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_parameters_history ( 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 matrix is to be reserved, false otherwise.

Definition at line 1097 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_parameters_norm_history ( 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 1109 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_training_direction_history ( bool  new_reserve_training_direction_history  ) 

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

Parameters:
new_reserve_training_direction_history True if the training direction history matrix is to be reserved, false otherwise.

Definition at line 1167 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_training_rate_history ( bool  new_reserve_training_rate_history  ) 

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

Parameters:
new_reserve_training_rate_history True if the training rate history vector is to be reserved, false otherwise.

Definition at line 1179 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_reserve_validation_error_history ( bool  new_reserve_validation_error_history  ) 

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

Parameters:
new_reserve_validation_error_history True if the validation error history is to be reserved, false otherwise.

Definition at line 1203 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_training_direction_history ( const Vector< Vector< double > > &  new_training_direction_history  ) 

This method sets a new vector of vectors containing the training direction history over the training epochs. Each element contains the training direction vector of one single epoch.

Parameters:
new_training_direction_history Training direction history.

Definition at line 1289 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_training_rate_history ( const Vector< double > &  new_training_rate_history  ) 

This method sets a new vector containing the training rate history over the training epochs. Each element in the vector contains the training rate of one single epoch.

Parameters:
new_training_rate_history Training rate history vector.

Definition at line 1301 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_training_rate_method ( const std::string &  new_training_rate_method_name  ) 

This method sets the method for obtaining the training rate from a string with the name of the method.

Parameters:
new_training_rate_method_name Name of training rate method

Definition at line 648 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_training_rate_method ( const TrainingRateMethod new_training_rate_method  ) 

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

Parameters:
new_training_rate_method Training rate method.

Definition at line 637 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_training_rate_tolerance ( double  new_training_rate_tolerance  ) 

This method sets a new tolerance value to be used in line minimization.

Parameters:
new_training_rate_tolerance Tolerance value in line minimization.

Definition at line 732 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_warning_gradient_norm ( double  new_warning_gradient_norm  ) 

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

Parameters:
new_warning_gradient_norm Warning norm of gradient vector value.

Definition at line 790 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_warning_parameters_norm ( 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 761 of file TrainingAlgorithm.cpp.

void Flood::TrainingAlgorithm::set_warning_training_rate ( double  new_warning_training_rate  ) 

This method sets a new training rate value at wich a warning message is written to the screen during line minimization.

Parameters:
new_warning_training_rate Warning training rate value.

Definition at line 819 of file TrainingAlgorithm.cpp.

std::string Flood::TrainingAlgorithm::to_XML ( bool  show_declaration  )  [virtual]

This method returns a default string representation in XML-type format of the training algorithm object. This containts the training operators, the training parameters, stopping criteria and other stuff.

Parameters:
show_declaration True if an XML-type declaration is to be included at the beginning.

Reimplemented in Flood::ConjugateGradient, Flood::EvolutionaryAlgorithm, Flood::GradientDescent, Flood::NewtonMethod, Flood::QuasiNewtonMethod, and Flood::RandomSearch.

Definition at line 1956 of file TrainingAlgorithm.cpp.

virtual void Flood::TrainingAlgorithm::train ( void   )  [pure virtual]

This method trains a multilayer perceptron which has a objective functional associated.

Implemented in Flood::ConjugateGradient, Flood::EvolutionaryAlgorithm, Flood::GradientDescent, Flood::NewtonMethod, Flood::QuasiNewtonMethod, and Flood::RandomSearch.


Member Data Documentation

Increase factor when bracketing a minimum.

Definition at line 263 of file TrainingAlgorithm.h.

Display messages to screen.

Definition at line 414 of file TrainingAlgorithm.h.

Number of epochs between the training showing progress.

Definition at line 418 of file TrainingAlgorithm.h.

True if early stopping is to be performed, and false otherwise.

Definition at line 326 of file TrainingAlgorithm.h.

Vector containing the elapsed time history over the training epochs.

Definition at line 404 of file TrainingAlgorithm.h.

Value for the gradient norm at which the training process is assumed to fail.

Definition at line 291 of file TrainingAlgorithm.h.

Value for the parameters norm at which the training process is assumed to fail.

Definition at line 287 of file TrainingAlgorithm.h.

Training rate at wich the line minimization algorithm is assumed to be unable to bracket a minimum.

Definition at line 295 of file TrainingAlgorithm.h.

Goal value for the objective. It is used as a train stopping criterion.

Definition at line 310 of file TrainingAlgorithm.h.

Vector containing the evaluation history over the training epochs.

Definition at line 380 of file TrainingAlgorithm.h.

Initial train rate in line minimization.

Definition at line 267 of file TrainingAlgorithm.h.

Vector of vectors containing the gradient history over the training epochs.

Definition at line 384 of file TrainingAlgorithm.h.

Goal value for the norm of the objective function gradient. It is used as a stopping criterion.

Definition at line 314 of file TrainingAlgorithm.h.

Vector containing the gradient norm history over the training epochs.

Definition at line 388 of file TrainingAlgorithm.h.

Vector of matrices containing the history of the inverse Hessian over the epochs.

Definition at line 392 of file TrainingAlgorithm.h.

Maximum number of epochs to train. It is used as a train stopping criterion.

Definition at line 318 of file TrainingAlgorithm.h.

Maximum training time. It is used as a train stopping criterion.

Definition at line 322 of file TrainingAlgorithm.h.

Minimum evaluation improvement between two successive epochs. It is used as a train stopping criterion.

Definition at line 306 of file TrainingAlgorithm.h.

Norm of the parameters increment vector at which training stops.

Definition at line 302 of file TrainingAlgorithm.h.

Pointer to an objective functional for a multilayer perceptron object.

Definition at line 253 of file TrainingAlgorithm.h.

Vector of vectors containing the parameters history over the training epochs.

Definition at line 372 of file TrainingAlgorithm.h.

Vector containing the parameters norm history over the training epochs.

Definition at line 376 of file TrainingAlgorithm.h.

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

Definition at line 364 of file TrainingAlgorithm.h.

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

Definition at line 340 of file TrainingAlgorithm.h.

True if the gradient history matrix is to be reserved, false otherwise.

Definition at line 344 of file TrainingAlgorithm.h.

True if the gradient norm history vector is to be reserved, false otherwise.

Definition at line 348 of file TrainingAlgorithm.h.

True if the inverse Hessian history vector of matrices is to be reserved, false otherwise.

Definition at line 352 of file TrainingAlgorithm.h.

True if the parameters history matrix is to be reserved, false otherwise.

Definition at line 332 of file TrainingAlgorithm.h.

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

Definition at line 336 of file TrainingAlgorithm.h.

True if the training direction history matrix is to be reserved, false otherwise.

Definition at line 356 of file TrainingAlgorithm.h.

True if the training rate history vector is to be reserved, false otherwise.

Definition at line 360 of file TrainingAlgorithm.h.

True if the validation error history vector is to be reserved, false otherwise.

Definition at line 368 of file TrainingAlgorithm.h.

Vector of vectors containing the training direction history over the epochs.

Definition at line 396 of file TrainingAlgorithm.h.

Vector containing the training rate history over the epochs.

Definition at line 400 of file TrainingAlgorithm.h.

Variable containing the actual method used to obtain a suitable train rate.

Definition at line 259 of file TrainingAlgorithm.h.

Tolerance for the train rate.

Definition at line 271 of file TrainingAlgorithm.h.

Vector containing the validation error history over the training epochs.

Definition at line 408 of file TrainingAlgorithm.h.

Value for the gradient norm at which a warning message is written to the screen.

Definition at line 279 of file TrainingAlgorithm.h.

Value for the parameters norm at which a warning message is written to the screen.

Definition at line 275 of file TrainingAlgorithm.h.

Training rate value at wich a warning message is written to the screen.

Definition at line 283 of file TrainingAlgorithm.h.


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

Generated on Fri Jul 30 09:52:00 2010 for Flood by  doxygen 1.5.9