14 #ifndef __QUASINEWTONMETHOD_H__
15 #define __QUASINEWTONMETHOD_H__
31 #include "performance_functional.h"
33 #include "training_algorithm.h"
34 #include "training_rate_algorithm.h"
38 #include "../tinyxml2/tinyxml2.h"
333 tinyxml2::XMLDocument*
to_XML(
void)
const;
338 void from_XML(
const tinyxml2::XMLDocument&);
Vector< Matrix< double > > inverse_Hessian_history
History of the inverse Hessian approximation over the training iterations.
double maximum_time
Maximum training time. It is used as a stopping criterion.
const double & get_error_training_rate(void) const
const bool & get_reserve_parameters_history(void) const
Returns true if the parameters history matrix is to be reserved, and false otherwise.
Vector< double > calculate_gradient_descent_training_direction(const Vector< double > &) const
Vector< double > elapsed_time_history
History of the elapsed time over the training iterations.
const double & get_warning_parameters_norm(void) const
Returns the minimum value for the norm of the parameters vector at wich a warning message is written ...
Matrix< double > final_inverse_Hessian_approximation
Final approximation of the inverse Hessian.
double error_training_rate
Training rate at wich the line minimization algorithm is assumed to be unable to bracket a minimum...
std::string write_inverse_Hessian_approximation_method(void) const
Returns the name of the method for the approximation of the inverse Hessian.
const bool & get_reserve_training_rate_history(void) const
Returns true if the training rate history vector is to be reserved, and false otherwise.
const bool & get_reserve_gradient_history(void) const
Returns true if the gradient history vector of vectors is to be reserved, and false otherwise...
InverseHessianApproximationMethod
Enumeration of the available training operators for obtaining the approximation to the inverse Hessia...
double final_gradient_norm
Final gradient norm.
void set_reserve_gradient_history(const bool &)
const bool & get_reserve_elapsed_time_history(void) const
Returns true if the elapsed time history vector is to be reserved, and false otherwise.
void set_error_parameters_norm(const double &)
double warning_gradient_norm
Value for the gradient norm at which a warning message is written to the screen.
const double & get_performance_goal(void) const
void set_reserve_all_training_history(const bool &)
void set_performance_goal(const double &)
void set_warning_parameters_norm(const double &)
const double & get_warning_training_rate(void) const
Returns the training rate value at wich a warning message is written to the screen during line minimi...
bool reserve_inverse_Hessian_history
True if the inverse Hessian history vector of matrices is to be reserved, false otherwise.
void set_error_gradient_norm(const double &)
void set_error_training_rate(const double &)
bool reserve_gradient_norm_history
True if the gradient norm history vector is to be reserved, false otherwise.
const bool & get_reserve_inverse_Hessian_history(void) const
Returns true if the inverse Hessian history is to be reserved, and false otherwise.
Vector< double > parameters_norm_history
History of the parameters norm over the training iterations.
const bool & get_reserve_gradient_norm_history(void) const
Returns true if the gradient norm history vector is to be reserved, and false otherwise.
const bool & get_reserve_generalization_performance_history(void) const
Returns true if the Generalization performance history vector is to be reserved, and false otherwise...
void set_display_period(const size_t &)
void set_default(void)
Sets the members of the training algorithm object to their default values.
const double & get_error_parameters_norm(void) const
Returns the value for the norm of the parameters vector at wich an error message is written to the sc...
void set_reserve_parameters_history(const bool &)
Vector< double > final_parameters
Final neural network parameters vector.
void set_reserve_parameters_norm_history(const bool &)
double error_parameters_norm
Value for the parameters norm at which the training process is assumed to fail.
Matrix< std::string > write_final_results(const size_t &precision=3) const
Returns a default (empty) string matrix with the final results from training.
size_t maximum_iterations_number
Maximum number of iterations to perform_training. It is used as a stopping criterion.
double minimum_parameters_increment_norm
Norm of the parameters increment vector at which training stops.
void set_warning_gradient_norm(const double &)
const double & get_warning_gradient_norm(void) const
Returns the minimum value for the norm of the gradient vector at wich a warning message is written to...
void set_maximum_iterations_number(const size_t &)
const double & get_gradient_norm_goal(void) const
void from_XML(const tinyxml2::XMLDocument &)
const TrainingRateAlgorithm & get_training_rate_algorithm(void) const
Returns a constant reference to the training rate algorithm object inside the quasi-Newton method obj...
QuasiNewtonMethodResults(void)
Default constructor.
double final_parameters_norm
Final neural network parameters norm.
double final_performance
Final performance function evaluation.
std::string write_training_algorithm_type(void) const
This method writes a string with the type of training algoritm.
Matrix< double > calculate_inverse_Hessian_approximation(const Vector< double > &, const Vector< double > &, const Vector< double > &, const Vector< double > &, const Matrix< double > &) const
Vector< double > final_training_direction
Final quasi-Newton method training direction.
Vector< double > final_gradient
Final performance function gradient.
QuasiNewtonMethod * get_quasi_Newton_method_pointer(void) const
Returns the pointer to the quasi-Newton method object required by the corresponding results structure...
double gradient_norm_goal
Goal value for the norm of the objective function gradient. It is used as a stopping criterion...
void set_warning_training_rate(const double &)
double warning_parameters_norm
Value for the parameters norm at which a warning message is written to the screen.
InverseHessianApproximationMethod inverse_Hessian_approximation_method
Variable containing the actual method used to obtain a suitable training rate.
const bool & get_reserve_parameters_norm_history(void) const
Returns true if the parameters norm history vector is to be reserved, and false otherwise.
void set_minimum_parameters_increment_norm(const double &)
QuasiNewtonMethodResults * perform_training(void)
double final_generalization_performance
Final generalization performance.
bool reserve_training_rate_history
True if the training rate history vector is to be reserved, false otherwise.
Vector< Vector< double > > gradient_history
History of the performance function gradient over the training iterations.
void set_inverse_Hessian_approximation_method(const InverseHessianApproximationMethod &)
void set_reserve_training_direction_history(const bool &)
Vector< double > generalization_performance_history
History of the generalization performance over the training iterations.
Vector< double > gradient_norm_history
History of the gradient norm over the training iterations.
const double & get_minimum_parameters_increment_norm(void) const
Returns the minimum norm of the parameter increment vector used as a stopping criteria when training...
size_t iterations_number
Maximum number of training iterations.
void set_maximum_generalization_performance_decreases(const size_t &)
virtual ~QuasiNewtonMethodResults(void)
Destructor.
void set_reserve_training_rate_history(const bool &)
bool reserve_parameters_norm_history
True if the parameters norm history vector is to be reserved, false otherwise.
bool reserve_performance_history
True if the performance history vector is to be reserved, false otherwise.
void set_reserve_inverse_Hessian_history(const bool &)
void set_reserve_elapsed_time_history(const bool &)
TrainingRateAlgorithm * get_training_rate_algorithm_pointer(void)
Returns a pointer to the training rate algorithm object inside the quasi-Newton method object...
std::string to_string(void) const
Returns a default string representation of a training algorithm.
Matrix< double > calculate_DFP_inverse_Hessian(const Vector< double > &, const Vector< double > &, const Vector< double > &, const Vector< double > &, const Matrix< double > &) const
void set_reserve_gradient_norm_history(const bool &)
QuasiNewtonMethod * quasi_Newton_method_pointer
Pointer to the quasi-Newton method object for which the training results are to be stored...
Vector< Vector< double > > training_direction_history
History of the random search training direction over the training iterations.
std::string to_string(void) const
Returns a string representation of the current quasi-Newton method results structure.
void set_minimum_performance_increase(const double &)
const double & get_error_gradient_norm(void) const
Vector< double > calculate_training_direction(const Vector< double > &, const Matrix< double > &) const
QuasiNewtonMethodResults(QuasiNewtonMethod *new_quasi_Newton_method_pointer)
Quasi-Newton method constructor.
bool reserve_elapsed_time_history
True if the elapsed time history vector is to be reserved, false otherwise.
Matrix< double > calculate_BFGS_inverse_Hessian(const Vector< double > &, const Vector< double > &, const Vector< double > &, const Vector< double > &, const Matrix< double > &) const
void set_reserve_generalization_performance_history(const bool &)
bool reserve_parameters_history
True if the parameters history matrix is to be reserved, false otherwise.
const size_t & get_maximum_generalization_performance_decreases(void) const
Returns the maximum number of generalization failures during the training process.
TrainingRateAlgorithm training_rate_algorithm
void set_performance_functional_pointer(PerformanceFunctional *)
bool reserve_training_direction_history
True if the training direction history matrix is to be reserved, false otherwise. ...
double error_gradient_norm
Value for the gradient norm at which the training process is assumed to fail.
Vector< double > performance_history
History of the performance function performance over the training iterations.
void set_quasi_Newton_method_pointer(QuasiNewtonMethod *)
Returns the pointer to the quasi-Newton method object required by the corresponding results structure...
Vector< Vector< double > > parameters_history
History of the neural network parameters over the training iterations.
double warning_training_rate
Training rate value at wich a warning message is written to the screen.
Vector< double > training_rate_history
History of the random search training rate over the training iterations.
void set_maximum_time(const double &)
double final_training_rate
Final quasi-Newton method training rate.
double elapsed_time
Elapsed time of the training process.
void set_gradient_norm_goal(const double &)
bool reserve_gradient_history
True if the gradient history matrix is to be reserved, false otherwise.
const bool & get_reserve_performance_history(void) const
Returns true if the performance history vector is to be reserved, and false otherwise.
double performance_goal
Goal value for the performance. It is used as a stopping criterion.
void resize_training_history(const size_t &)
const bool & get_reserve_training_direction_history(void) const
Returns true if the training direction history matrix is to be reserved, and false otherwise...
double minimum_performance_increase
Minimum performance improvement between two successive iterations. It is used as a stopping criterion...
const InverseHessianApproximationMethod & get_inverse_Hessian_approximation_method(void) const
Returns the method for approximating the inverse Hessian matrix to be used when training.
size_t maximum_generalization_performance_decreases
tinyxml2::XMLDocument * to_XML(void) const
const double & get_minimum_performance_increase(void) const
Returns the minimum performance improvement during training.
const double & get_maximum_time(void) const
Returns the maximum training time.
void set_reserve_performance_history(const bool &)
Matrix< std::string > to_string_matrix(void) const
const size_t & get_maximum_iterations_number(void) const
Returns the maximum number of iterations for training.
bool reserve_generalization_performance_history
True if the Generalization performance history vector is to be reserved, false otherwise.
virtual ~QuasiNewtonMethod(void)