#include <ObjectiveFunctional.h>
Definition at line 35 of file ObjectiveFunctional.h.
Enumeration of available methods for calculating any derivative of the objective function numerically.
Definition at line 61 of file ObjectiveFunctional.h.
Enumeration of available methods for obtaining a numerical value of epsilon to be used in numerical differentiation.
Definition at line 65 of file ObjectiveFunctional.h.
Flood::ObjectiveFunctional::ObjectiveFunctional | ( | void | ) | [explicit] |
General constructor. It creates an objective functional object not associated to any multilayer perceptron object. It also initializes all the rest of class members to their default values.
Definition at line 53 of file ObjectiveFunctional.cpp.
Flood::ObjectiveFunctional::ObjectiveFunctional | ( | MultilayerPerceptron * | new_multilayer_perceptron_pointer | ) | [explicit] |
General constructor. It creates an objective functional object associated to a multilayer perceptron object. It also initializes all the rest of class members to their default values.
new_multilayer_perceptron_pointer | Pointer to a multilayer perceptron object. |
Definition at line 40 of file ObjectiveFunctional.cpp.
Flood::ObjectiveFunctional::~ObjectiveFunctional | ( | void | ) | [virtual] |
double Flood::ObjectiveFunctional::calculate_actual_epsilon | ( | double | parameter | ) |
This method returns the numerical epsilon value to be used for numerical differentiation, according to the numerical epsilon method used.
parameter | Parameter value on which depends the numerical epsilon value. |
Definition at line 833 of file ObjectiveFunctional.cpp.
Matrix< double > Flood::ObjectiveFunctional::calculate_BFGS_inverse_Hessian | ( | const Vector< double > & | old_parameters, | |
const Vector< double > & | parameters, | |||
const Vector< double > & | old_gradient, | |||
const Vector< double > & | gradient, | |||
const Matrix< double > & | old_inverse_Hessian | |||
) |
This method returns an approximation of the inverse Hessian matrix according to the Broyden-Fletcher-Goldfarb-Shanno (BGFS) algorithm.
old_parameters | A previous set of parameters. | |
old_gradient | The gradient of the objective function for that previous set of parameters. | |
old_inverse_Hessian | The Hessian of the objective function for that previous set of parameters. | |
parameters | Actual set of parameters. | |
gradient | The gradient of the objective function for the actual set of parameters. |
Definition at line 1720 of file ObjectiveFunctional.cpp.
Matrix< double > Flood::ObjectiveFunctional::calculate_DFP_inverse_Hessian | ( | const Vector< double > & | old_parameters, | |
const Vector< double > & | parameters, | |||
const Vector< double > & | old_gradient, | |||
const Vector< double > & | gradient, | |||
const Matrix< double > & | old_inverse_Hessian | |||
) |
This method returns an approximation of the inverse Hessian matrix according to the Davidon-Fletcher-Powel (DFP) algorithm.
old_parameters | A previous set of parameters. | |
old_gradient | The gradient of the objective function for that previous set of parameters. | |
old_inverse_Hessian | The Hessian of the objective function for that previous set of parameters. | |
parameters | Actual set of parameters. | |
gradient | The gradient of the objective function for the actual set of parameters. |
Definition at line 1557 of file ObjectiveFunctional.cpp.
double Flood::ObjectiveFunctional::calculate_evaluation | ( | void | ) |
This method calculates the evaluation value of the objective functional, as the sum of the objective and the regularization terms.
Definition at line 616 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_gradient | ( | void | ) |
This method returns the objective function gradient, as the sum of the objective and the regularization gradient vectors.
Definition at line 724 of file ObjectiveFunctional.cpp.
double Flood::ObjectiveFunctional::calculate_gradient_norm | ( | void | ) |
This method returns the norm of the objective function gradient vector.
Definition at line 745 of file ObjectiveFunctional.cpp.
Matrix< double > Flood::ObjectiveFunctional::calculate_Hessian | ( | void | ) | [virtual] |
This method returns the objective function Hessian matrix for a multilayer perceptron.
This method returns the default objective function Hessian matrix, which is computed using numerical differentiation.
Definition at line 1471 of file ObjectiveFunctional.cpp.
Matrix< double > Flood::ObjectiveFunctional::calculate_Hessian_central_differences | ( | void | ) |
This method returns the Hessian matrix of the objective function calculated by means of the central differences method for numerical differentiation.
Definition at line 1321 of file ObjectiveFunctional.cpp.
Matrix< double > Flood::ObjectiveFunctional::calculate_Hessian_forward_differences | ( | void | ) |
This method returns the Hessian matrix of the objective function calculated by means of the forward differences method for numerical differentiation.
Definition at line 1300 of file ObjectiveFunctional.cpp.
Matrix< double > Flood::ObjectiveFunctional::calculate_Hessian_numerical_differentiation | ( | void | ) |
This method returns the Hessian matrix of the objective function calculated by means of the chosen method for numerical differentiation.
Definition at line 1434 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_independent_parameters_gradient_central_differences | ( | void | ) |
This method returns the derivatives of the objective function with respect to the independent parameters by means of the forward differences method for numerical differentiation.
Definition at line 1139 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_independent_parameters_gradient_forward_differences | ( | void | ) |
This method returns the derivatives of the objective function with respect to the independent parameters by means of the forward differences method for numerical differentiation.
Definition at line 1069 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_independent_parameters_gradient_numerical_differentiation | ( | void | ) |
This method returns the derivatives of the objective function with respect to the independent parameters by means of numerical differentiation. This vector depends on the numerical differentiation method used.
Definition at line 1032 of file ObjectiveFunctional.cpp.
Matrix< double > Flood::ObjectiveFunctional::calculate_inverse_Hessian | ( | void | ) | [virtual] |
This method returns inverse matrix of the Hessian. It first computes the Hessian matrix and then computes its inverse.
Definition at line 1537 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_neural_parameters_gradient_central_differences | ( | void | ) |
This method returns the derivatives of the objective function with respect to the neural parameters by means of the central differences method for numerical differentiation.
Definition at line 971 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_neural_parameters_gradient_forward_differences | ( | void | ) |
This method returns the derivatives of the objective function with respect to the neural parameters by means of the forward differences method for numerical differentiation.
Definition at line 917 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_neural_parameters_gradient_numerical_differentiation | ( | void | ) |
This method returns the derivatives of the objective function with respect to the neural parameters by means of numerical differentiation. This vector depends on the numerical differentiation method used.
Definition at line 881 of file ObjectiveFunctional.cpp.
virtual double Flood::ObjectiveFunctional::calculate_objective | ( | void | ) | [pure virtual] |
This method returns the objective value of a multilayer perceptron.
Implemented in Flood::MeanSquaredError, Flood::MinkowskiError, Flood::NormalizedSquaredError, Flood::RootMeanSquaredError, and Flood::SumSquaredError.
Vector< double > Flood::ObjectiveFunctional::calculate_objective_gradient | ( | void | ) | [virtual] |
This method returns the objective function gradient vector for a multilayer perceptron.
This method returns the default objective function gradient vector, which is computed using numerical differentiation.
Reimplemented in Flood::MeanSquaredError, Flood::MinkowskiError, Flood::NormalizedSquaredError, Flood::RootMeanSquaredError, and Flood::SumSquaredError.
Definition at line 758 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_objective_gradient_numerical_differentiation | ( | void | ) |
This method calculates the gradient of the objective term in by means of numerical differentiation.
Definition at line 771 of file ObjectiveFunctional.cpp.
double Flood::ObjectiveFunctional::calculate_potential_evaluation | ( | const Vector< double > & | potential_parameters | ) |
This method returns which would be the objective evaluation of a multilayer perceptron for an hypothetical vector of parameters. It does not set that vector of parameters to the multilayer perceptron.
potential_parameters | Vector of a potential parameters for the multilayer perceptron associated to the objective functional. |
Definition at line 681 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_potential_gradient | ( | const Vector< double > & | potential_parameters | ) |
This method returns which would be the objective function gradient of a multilayer perceptron for an hypothetical vector of parameters. It does not set that vector of parameters to the multilayer perceptron.
potential_parameters | Vector of a potential parameters for the multilayer perceptron associated to the objective functional. |
Definition at line 1237 of file ObjectiveFunctional.cpp.
Matrix< double > Flood::ObjectiveFunctional::calculate_potential_Hessian | ( | const Vector< double > & | potential_parameters | ) |
This method returns which would be the objective function Hessian of a multilayer perceptron for an hypothetical vector of parameters. It does not set that vector of parameters to the multilayer perceptron.
potential_parameters | Vector of a potential parameters for the multilayer perceptron associated to the objective functional. |
Definition at line 1489 of file ObjectiveFunctional.cpp.
double Flood::ObjectiveFunctional::calculate_regularization | ( | void | ) | [virtual] |
This method returns the evaluation of the regularization term in the objective functional, according to the regularization method used.
Definition at line 643 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_regularization_gradient | ( | void | ) | [virtual] |
This method calculates the gradient of the regularization term in by means of numerical differentiation.
Definition at line 784 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_vector_dot_Hessian | ( | const Vector< double > & | vector | ) | [virtual] |
This method returns the default product of some vector with the objective function Hessian matrix, which is computed using numerical differentiation.
vector | Vector in the dot product. |
Definition at line 1968 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_vector_dot_Hessian_central_differences | ( | const Vector< double > & | vector | ) |
This method returns the dot product between a given vector and the Hessian matrix of the objective function by means of the forward differences method for numerical differentiation.
vector | Vector in the dot product. |
Definition at line 1893 of file ObjectiveFunctional.cpp.
Vector< double > Flood::ObjectiveFunctional::calculate_vector_dot_Hessian_forward_differences | ( | const Vector< double > & | ) |
This method returns the dot product between a given vector and the Hessian matrix of the objective function by means of the forward differences method for numerical differentiation.
vector | Vector in the dot product. |
Definition at line 1870 of file ObjectiveFunctional.cpp.
int Flood::ObjectiveFunctional::get_calculate_evaluation_count | ( | void | ) |
This method returns the number of calls to the calculate_evaluation(void) method.
Definition at line 237 of file ObjectiveFunctional.cpp.
int Flood::ObjectiveFunctional::get_calculate_gradient_count | ( | void | ) |
This method returns the number of calls to the calculate_gradient(void) method.
Definition at line 247 of file ObjectiveFunctional.cpp.
int Flood::ObjectiveFunctional::get_calculate_Hessian_count | ( | void | ) |
This method returns the number of calls to the calculate_Hessian(void) method.
Definition at line 257 of file ObjectiveFunctional.cpp.
bool Flood::ObjectiveFunctional::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 268 of file ObjectiveFunctional.cpp.
MultilayerPerceptron* Flood::ObjectiveFunctional::get_multilayer_perceptron_pointer | ( | void | ) | [inline] |
This method returns a pointer to the multilayer perceptron object associated to the objective functional.
Definition at line 73 of file ObjectiveFunctional.h.
ObjectiveFunctional::NumericalDifferentiationMethod Flood::ObjectiveFunctional::get_numerical_differentiation_method | ( | void | ) |
This method returns the method used for numerical differentiation.
Definition at line 140 of file ObjectiveFunctional.cpp.
std::string Flood::ObjectiveFunctional::get_numerical_differentiation_method_name | ( | void | ) |
This method returns a string with the name of the numerical differentiation method.
Definition at line 160 of file ObjectiveFunctional.cpp.
double Flood::ObjectiveFunctional::get_numerical_epsilon | ( | void | ) |
This method returns the epsilon value for the calculation of the objective function gradient by means of numerical differentiation.
Definition at line 227 of file ObjectiveFunctional.cpp.
ObjectiveFunctional::NumericalEpsilonMethod Flood::ObjectiveFunctional::get_numerical_epsilon_method | ( | void | ) |
This method returns the method used for obtaining a numerical epsilon value.
Definition at line 150 of file ObjectiveFunctional.cpp.
std::string Flood::ObjectiveFunctional::get_numerical_epsilon_method_name | ( | void | ) |
This method returns a string with the name of the method to be used for obtaining a numerical epsilon value.
Definition at line 193 of file ObjectiveFunctional.cpp.
double Flood::ObjectiveFunctional::get_objective_weight | ( | void | ) |
This method returns the weight value of the objective term in the objective functional expression.
Definition at line 77 of file ObjectiveFunctional.cpp.
ObjectiveFunctional::RegularizationMethod & Flood::ObjectiveFunctional::get_regularization_method | ( | void | ) |
This method returns the regularization method to be used in the objective functional expression.
Definition at line 87 of file ObjectiveFunctional.cpp.
std::string Flood::ObjectiveFunctional::get_regularization_method_name | ( | void | ) |
This method returns a string with the name of the regularization method.
Definition at line 97 of file ObjectiveFunctional.cpp.
double Flood::ObjectiveFunctional::get_regularization_weight | ( | void | ) |
This method returns the weight value of the regularization term in the objective functional expression.
Definition at line 130 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::load | ( | const char * | filename | ) | [virtual] |
This method loads a default objective functional XML-type file.
filename | Name of default XML-type objective functional file. |
Reimplemented in Flood::MinkowskiError.
Definition at line 2122 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::print | ( | void | ) | [virtual] |
This method prints the members of the objective functional object to the screen in XML-type format.
Definition at line 2081 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::print_information | ( | void | ) | [virtual] |
This method prints any useful information about the objective function during training. By default it prints nothing.
Definition at line 2368 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::save | ( | const char * | filename | ) | [virtual] |
This method saves to a XML-type file a string representation of the objective functional object.
filename | Name of XML-type objective functional file. |
Definition at line 2092 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_calculate_evaluation_count | ( | int | new_calculate_evaluation_count | ) |
This method sets the number of calls to the get_objective(void) method to a new value.
new_calculate_evaluation_count | New number of calls to the calculate_evaluation(void) method. |
Definition at line 531 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_calculate_gradient_count | ( | int | new_calculate_gradient_count | ) |
This method sets the number of calls to the calculate_gradient(void) method to a new value.
new_calculate_gradient_count | New number of calls to the calculate_gradient(void) method. |
Definition at line 555 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_calculate_Hessian_count | ( | int | new_calculate_Hessian_count | ) |
This method sets the number of calls to the calculate_Hessian(void) method to a new value.
new_calculate_Hessian_count | New number of calls to the calculate_Hessian(void) method. |
Definition at line 579 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_default | ( | void | ) |
This method sets the members of the objective functional object to their default values:
Definition at line 303 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::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.
new_display | Display value. |
Definition at line 605 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_multilayer_perceptron_pointer | ( | MultilayerPerceptron * | new_multilayer_perceptron_pointer | ) |
This method sets a pointer to a multilayer perceptron object which is to be associated to the objective functional.
new_multilayer_perceptron_pointer | Pointer to a multilayer percepron object to be associated to the objective functional. |
Definition at line 281 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_numerical_differentiation_method | ( | const std::string & | new_numerical_differentiation_method_name | ) |
This method sets a new numerical differentiation method from a string with the name of the method.
new_numerical_differentiation_method_name | Name of numerical differentiation method. |
Definition at line 361 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_numerical_differentiation_method | ( | const NumericalDifferentiationMethod & | new_numerical_differentiation_method | ) |
This method sets the method to be used for the numerical differentiation of the error function derivatives.
new_numerical_differentiation_method | New numerical differentiation method. |
Definition at line 337 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_numerical_epsilon | ( | double | new_numerical_epsilon | ) |
This method sets a new epsilon value for the calculation of the objective function gradient by means of numerical differentiation.
new_numerical_epsilon | New value for epsilon. |
Definition at line 413 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_numerical_epsilon_method | ( | const std::string & | new_numerical_epsilon_method_name | ) |
This method sets a new numerical epsilon method from a string with the name of the method.
new_numerical_epsilon_method_name | Name of numerical epsilon method. |
Definition at line 386 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_numerical_epsilon_method | ( | const NumericalEpsilonMethod & | new_numerical_epsilon_method | ) |
This method sets the method to be used for obtaining a numerical epsilon value to be used in numerical differentiation.
new_numerical_epsilon_method | New numerical epsilon method. |
Definition at line 350 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_objective_weight | ( | double | new_objective_weight | ) |
This method sets a new weight value for the objective term in the objective functional expression.
new_objective_weight | Weight value for the objective term. |
Definition at line 441 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_regularization_method | ( | const std::string & | new_regularization_method_name | ) |
This method sets a new regularization method from a string with the name of that method.
new_regularization_method_name | Regularization method name. |
Definition at line 479 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_regularization_method | ( | const RegularizationMethod & | new_regularization_method | ) |
This method sets a new regularization method for the objective functional expression.
new_regularization_method | Regularization method. |
Definition at line 468 of file ObjectiveFunctional.cpp.
void Flood::ObjectiveFunctional::set_regularization_weight | ( | double | new_regularization_weight | ) |
This method sets a new weight value for the regularization term in the objective functional expression.
new_regularization_weight | Weight value for the regularization term. |
Definition at line 505 of file ObjectiveFunctional.cpp.
std::string Flood::ObjectiveFunctional::to_XML | ( | bool | show_declaration | ) | [virtual] |
This method returns a default string representation of and objective functional object, in a XML-type format.
show_declaration | True if an XML-type declaration is to be included at the beginning. |
Reimplemented in Flood::MinkowskiError.
Definition at line 2023 of file ObjectiveFunctional.cpp.
int Flood::ObjectiveFunctional::calculate_evaluation_count [protected] |
Number of calls to the calculate_evaluation(void) method.
Definition at line 251 of file ObjectiveFunctional.h.
int Flood::ObjectiveFunctional::calculate_gradient_count [protected] |
Number of calls to the calculate_gradient(void) method.
Definition at line 255 of file ObjectiveFunctional.h.
int Flood::ObjectiveFunctional::calculate_Hessian_count [protected] |
Number of calls to the calculate_Hessian(void) method.
Definition at line 259 of file ObjectiveFunctional.h.
bool Flood::ObjectiveFunctional::display [protected] |
NumericalDifferentiationMethod Flood::ObjectiveFunctional::numerical_differentiation_method [protected] |
Numerical differentiation methods enumeration.
Definition at line 263 of file ObjectiveFunctional.h.
double Flood::ObjectiveFunctional::numerical_epsilon [protected] |
Epsilon value for the calculation of any derivative with numerical differentiation.
Definition at line 271 of file ObjectiveFunctional.h.
double Flood::ObjectiveFunctional::objective_weight [protected] |
Weight of the objective term in the objective functional expression.
Definition at line 239 of file ObjectiveFunctional.h.
double Flood::ObjectiveFunctional::regularization_weight [protected] |
Weight of the regularization term in the objective functional expression.
Definition at line 247 of file ObjectiveFunctional.h.