14 #ifndef __LEVENBERGMARQUARDTALGORITHM_H__
15 #define __LEVENBERGMARQUARDTALGORITHM_H__
31 #include "training_algorithm.h"
35 #include "../tinyxml2/tinyxml2.h"
281 void check(
void)
const;
295 tinyxml2::XMLDocument*
to_XML(
void)
const;
297 void from_XML(
const tinyxml2::XMLDocument&);
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...
void set_warning_parameters_norm(const double &)
virtual ~LevenbergMarquardtAlgorithmResults(void)
Destructor.
void set_reserve_generalization_performance_history(const bool &)
const bool & get_reserve_generalization_performance_history(void) const
Returns true if the Generalization performance history vector is to be reserved, and false otherwise...
Vector< double > calculate_gradient(const Vector< double > &, const Matrix< double > &) const
double minimum_damping_parameter
Minimum Levenberg-Marquardt parameter.
bool reserve_gradient_norm_history
True if the gradient norm history vector is to be reserved, false otherwise.
void set_error_parameters_norm(const double &)
LevenbergMarquardtAlgorithm * Levenberg_Marquardt_algorithm_pointer
Pointer to the Levenberg-Marquardt algorithm object for which the training results are to be stored...
void set_reserve_parameters_history(const bool &)
void resize_training_history(const size_t &)
void set_display_period(const size_t &)
bool reserve_generalization_performance_history
True if the Generalization performance history vector is to be reserved, false otherwise.
const double & get_performance_goal(void) const
double minimum_parameters_increment_norm
Norm of the parameters increment vector at which training stops.
bool reserve_Hessian_approximation_history
True if the Hessian history vector of matrices is to be reserved, false otherwise.
const double & get_error_parameters_norm(void) const
double calculate_performance(const Vector< double > &) const
double final_performance
Final performance function evaluation.
virtual void set_reserve_all_training_history(const bool &)
Makes the training history of all variables to be reseved or not in memory.
const size_t & get_maximum_iterations_number(void) const
Returns the maximum number of iterations for training.
double final_generalization_performance
Final generalization performance.
bool reserve_damping_parameter_history
True if the damping parameter history vector is to be reserved, false otherwise.
size_t maximum_iterations_number
Maximum number of iterations to perform_training. It is used as a stopping criterion.
size_t iterations_number
Maximum number of training iterations.
void set_reserve_parameters_norm_history(const bool &)
double minimum_performance_increase
Minimum performance improvement between two successive iterations. It is used as a stopping criterion...
bool reserve_parameters_norm_history
True if the parameters norm history vector is to be reserved, false otherwise.
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_reserve_Hessian_approximation_history(const bool &)
double performance_goal
Goal value for the performance. It is used as a stopping criterion.
const double & get_warning_gradient_norm(void) const
void set_error_gradient_norm(const double &)
Vector< double > damping_parameter_history
Vector containing the damping parameter history over the training iterations.
const size_t & get_maximum_generalization_performance_decreases(void) const
Returns the maximum number of generalization failures during the training process.
Vector< double > damping_parameter_history
History of the damping parameter over the training iterations.
const Vector< double > & get_damping_parameter_history(void) const
Returns a vector containing the damping parameter history over the training iterations.
double final_parameters_norm
Final neural network parameters norm.
double warning_parameters_norm
Value for the parameters norm at which a warning message is written to the screen.
Matrix< std::string > write_final_results(const size_t &precision=3) const
Returns a default (empty) string matrix with the final results from training.
void set_minimum_performance_increase(const double &)
Vector< double > gradient_norm_history
History of the gradient 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.
std::string write_training_algorithm_type(void) const
This method writes a string with the type of training algoritm.
void set_reserve_gradient_history(const bool &)
const bool & get_reserve_Hessian_approximation_history(void) const
double maximum_damping_parameter
Maximum Levenberg-Marquardt parameter.
const double & get_error_gradient_norm(void) const
void set_maximum_time(const double &)
tinyxml2::XMLDocument * to_XML(void) const
size_t maximum_generalization_performance_decreases
void set_minimum_damping_parameter(const double &)
double damping_parameter_factor
Damping parameter increase/decrease factor.
Vector< double > generalization_performance_history
History of the generalization performance over the training iterations.
Vector< Vector< double > > gradient_history
History of the performance function gradient over the training iterations.
void from_XML(const tinyxml2::XMLDocument &)
const double & get_maximum_time(void) const
Returns the maximum training time.
double final_gradient_norm
Final gradient norm.
LevenbergMarquardtAlgorithmResults(void)
Default constructor.
virtual ~LevenbergMarquardtAlgorithm(void)
Vector< double > performance_history
History of the performance function performance over the training iterations.
const double & get_damping_parameter(void) const
Returns the damping parameter for the Hessian approximation.
void set_gradient_norm_goal(const double &)
Vector< Vector< double > > parameters_history
History of the neural network parameters over the training iterations.
Vector< double > elapsed_time_history
History of the elapsed time over the training iterations.
const bool & get_reserve_gradient_history(void) const
Returns true if the gradient history vector of vectors is to be reserved, and false otherwise...
void set_reserve_damping_parameter_history(const bool &)
void set_minimum_parameters_increment_norm(const double &)
double error_parameters_norm
Value for the parameters norm at which the training process is assumed to fail.
bool reserve_performance_history
True if the performance history vector is to be reserved, false otherwise.
const double & get_warning_parameters_norm(void) const
void set_reserve_elapsed_time_history(const bool &)
void set_damping_parameter_factor(const double &)
LevenbergMarquardtAlgorithmResults * perform_training(void)
double maximum_time
Maximum training time. It is used as a stopping criterion.
double error_gradient_norm
Value for the gradient norm at which the training process is assumed to fail.
Matrix< double > calculate_Hessian_approximation(const Matrix< double > &) const
LevenbergMarquardtAlgorithm(void)
void set_maximum_iterations_number(const size_t &)
const bool & get_reserve_performance_history(void) const
Returns true if the performance history vector is to be reserved, and false otherwise.
void set_reserve_gradient_norm_history(const bool &)
void set_maximum_damping_parameter(const double &)
const double & get_gradient_norm_goal(void) const
std::string to_string(void) const
Returns a string representation of the current Levenberg-Marquardt algorithm results structure...
bool reserve_parameters_history
True if the parameters history matrix is to be reserved, false otherwise.
void set_damping_parameter(const double &)
const bool & get_reserve_parameters_history(void) const
Returns true if the parameters history matrix is to be reserved, and false otherwise.
LevenbergMarquardtAlgorithmResults(LevenbergMarquardtAlgorithm *new_Levenberg_Marquardt_algorithm_pointer)
Random search constructor.
void set_warning_gradient_norm(const double &)
Vector< double > final_parameters
Final neural network parameters vector.
double gradient_norm_goal
Goal value for the norm of the objective function gradient. It is used as a stopping criterion...
void set_maximum_generalization_performance_decreases(const size_t &)
Matrix< std::string > to_string_matrix(void) const
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_performance_goal(const double &)
Vector< Matrix< double > > Hessian_approximation_history
History of the Hessian approximation over the training iterations.
double elapsed_time
Elapsed time of the training process.
const double & get_damping_parameter_factor(void) const
Returns the damping parameter factor (beta in the User's Guide) for the Hessian approximation.
bool reserve_gradient_history
True if the gradient history matrix is to be reserved, false otherwise.
Vector< double > final_gradient
Final performance function gradient.
double damping_parameter
Initial Levenberg-Marquardt parameter.
const double & get_maximum_damping_parameter(void) const
Returns the maximum damping parameter allowed in the algorithm.
Vector< double > perform_Householder_QR_decomposition(const Matrix< double > &, const Vector< double > &) const
Uses Eigen to solve the system of equations by means of the Householder QR decomposition.
const bool & get_reserve_damping_parameter_history(void) const
Returns true if the damping parameter history vector is to be reserved, and false otherwise...
Vector< double > parameters_norm_history
History of the parameters norm over the training iterations.
double warning_gradient_norm
Value for the gradient norm at which a warning message is written to the screen.
const double & get_minimum_performance_increase(void) const
Returns the minimum performance improvement during training.
const double & get_minimum_damping_parameter(void) const
Returns the minimum damping parameter allowed in the algorithm.
bool reserve_elapsed_time_history
True if the elapsed time history vector is to be reserved, false otherwise.
void set_reserve_performance_history(const bool &)