OpenNN  2.2
Open Neural Networks Library
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
OpenNN::PerformanceFunctional Class Reference

#include <performance_functional.h>

Classes

struct  FirstOrderperformance
 
struct  SecondOrderperformance
 
struct  ZeroOrderperformance
 

Public Types

enum  ObjectiveType {
  NO_OBJECTIVE, SUM_SQUARED_ERROR_OBJECTIVE, MEAN_SQUARED_ERROR_OBJECTIVE, ROOT_MEAN_SQUARED_ERROR_OBJECTIVE,
  NORMALIZED_SQUARED_ERROR_OBJECTIVE, MINKOWSKI_ERROR_OBJECTIVE, CROSS_ENTROPY_ERROR_OBJECTIVE, OUTPUTS_INTEGRALS_OBJECTIVE,
  SOLUTIONS_ERROR_OBJECTIVE, FINAL_SOLUTIONS_ERROR_OBJECTIVE, INDEPENDENT_PARAMETERS_ERROR_OBJECTIVE, INVERSE_SUM_SQUARED_ERROR_OBJECTIVE,
  USER_OBJECTIVE
}
 
enum  RegularizationType { NO_REGULARIZATION, NEURAL_PARAMETERS_NORM_REGULARIZATION, OUTPUTS_INTEGRALS_REGULARIZATION, USER_REGULARIZATION }
 
enum  ConstraintsType {
  NO_CONSTRAINTS, OUTPUTS_INTEGRALS_CONSTRAINTS, SOLUTIONS_ERROR_CONSTRAINTS, FINAL_SOLUTIONS_ERROR_CONSTRAINTS,
  INDEPENDENT_PARAMETERS_ERROR_CONSTRAINTS, USER_CONSTRAINTS
}
 

Public Member Functions

 PerformanceFunctional (void)
 
 PerformanceFunctional (PerformanceTerm *)
 
 PerformanceFunctional (NeuralNetwork *)
 
 PerformanceFunctional (NeuralNetwork *, DataSet *)
 
 PerformanceFunctional (NeuralNetwork *, MathematicalModel *)
 
 PerformanceFunctional (NeuralNetwork *, MathematicalModel *, DataSet *)
 
 PerformanceFunctional (const std::string &)
 
 PerformanceFunctional (const tinyxml2::XMLDocument &)
 
 PerformanceFunctional (const PerformanceFunctional &)
 
virtual ~PerformanceFunctional (void)
 
void check_neural_network (void) const
 
void check_performance_terms (void) const
 
NeuralNetworkget_neural_network_pointer (void) const
 
MathematicalModelget_mathematical_model_pointer (void) const
 
DataSetget_data_set_pointer (void) const
 
bool has_neural_network (void) const
 
bool has_mathematical_model (void) const
 
bool has_data_set (void) const
 
bool has_generalization (void) const
 
bool is_sum_squared_terms (void) const
 
SumSquaredErrorget_sum_squared_error_objective_pointer (void) const
 
MeanSquaredErrorget_mean_squared_error_objective_pointer (void) const
 
RootMeanSquaredErrorget_root_mean_squared_error_objective_pointer (void) const
 
NormalizedSquaredErrorget_normalized_squared_error_objective_pointer (void) const
 
MinkowskiErrorget_Minkowski_error_objective_pointer (void) const
 
CrossEntropyErrorget_cross_entropy_error_objective_pointer (void) const
 
OutputsIntegralsget_outputs_integrals_objective_pointer (void) const
 
SolutionsErrorget_solutions_error_objective_pointer (void) const
 
FinalSolutionsErrorget_final_solutions_error_objective_pointer (void) const
 
IndependentParametersErrorget_independent_parameters_error_objective_pointer (void) const
 
InverseSumSquaredErrorget_inverse_sum_squared_error_objective_pointer (void) const
 
PerformanceTermget_user_objective_pointer (void) const
 
NeuralParametersNormget_neural_parameters_norm_regularization_pointer (void) const
 
OutputsIntegralsget_outputs_integrals_regularization_pointer (void) const
 
PerformanceTermget_user_regularization_pointer (void) const
 
OutputsIntegralsget_outputs_integrals_constraints_pointer (void) const
 
SolutionsErrorget_solutions_error_constraints_pointer (void) const
 
FinalSolutionsErrorget_final_solutions_error_constraints_pointer (void) const
 
IndependentParametersErrorget_independent_parameters_error_constraints_pointer (void) const
 
PerformanceTermget_user_constraints_pointer (void) const
 
const ObjectiveTypeget_objective_type (void) const
 
const RegularizationTypeget_regularization_type (void) const
 
const ConstraintsTypeget_constraints_type (void) const
 
std::string write_objective_type (void) const
 
std::string write_regularization_type (void) const
 
std::string write_constraints_type (void) const
 
std::string write_objective_type_text (void) const
 
std::string write_regularization_type_text (void) const
 
std::string write_constraints_type_text (void) const
 
const bool & get_display (void) const
 
void set_neural_network_pointer (NeuralNetwork *)
 
void set_mathematical_model_pointer (MathematicalModel *)
 
void set_data_set_pointer (DataSet *)
 
void set_user_objective_pointer (PerformanceTerm *)
 
void set_user_regularization_pointer (PerformanceTerm *)
 
void set_user_constraints_pointer (PerformanceTerm *)
 
void set_default (void)
 
void set_objective_type (const ObjectiveType &)
 
void set_regularization_type (const RegularizationType &)
 
void set_constraints_type (const ConstraintsType &)
 
void set_objective_type (const std::string &)
 
void set_regularization_type (const std::string &)
 
void set_constraints_type (const std::string &)
 
void destruct_objective (void)
 
void destruct_regularization (void)
 
void destruct_constraints (void)
 
void destruct_all_terms (void)
 
void set_display (const bool &)
 
double calculate_objective (void) const
 
double calculate_regularization (void) const
 
double calculate_constraints (void) const
 
double calculate_objective (const Vector< double > &) const
 
double calculate_regularization (const Vector< double > &) const
 
double calculate_constraints (const Vector< double > &) const
 
Vector< double > calculate_objective_terms (void) const
 
Vector< double > calculate_regularization_terms (void) const
 
Vector< double > calculate_constraints_terms (void) const
 
Matrix< double > calculate_objective_terms_Jacobian (void) const
 
Matrix< double > calculate_regularization_terms_Jacobian (void) const
 
Matrix< double > calculate_constraints_terms_Jacobian (void) const
 
Vector< double > calculate_objective_gradient (void) const
 
Vector< double > calculate_regularization_gradient (void) const
 
Vector< double > calculate_constraints_gradient (void) const
 
Vector< double > calculate_objective_gradient (const Vector< double > &) const
 
Vector< double > calculate_regularization_gradient (const Vector< double > &) const
 
Vector< double > calculate_constraints_gradient (const Vector< double > &) const
 
Matrix< double > calculate_objective_Hessian (void) const
 
Matrix< double > calculate_regularization_Hessian (void) const
 
Matrix< double > calculate_constraints_Hessian (void) const
 
Matrix< double > calculate_objective_Hessian (const Vector< double > &) const
 
Matrix< double > calculate_regularization_Hessian (const Vector< double > &) const
 
Matrix< double > calculate_constraints_Hessian (const Vector< double > &) const
 
double calculate_performance (void) const
 
Vector< double > calculate_gradient (void) const
 
Matrix< double > calculate_Hessian (void) const
 
double calculate_performance (const Vector< double > &) const
 
Vector< double > calculate_gradient (const Vector< double > &) const
 
Matrix< double > calculate_Hessian (const Vector< double > &) const
 
virtual Matrix< double > calculate_inverse_Hessian (void) const
 
virtual Vector< double > calculate_vector_dot_Hessian (const Vector< double > &) const
 
Vector< double > calculate_terms (void) const
 
Matrix< double > calculate_terms_Jacobian (void) const
 
virtual ZeroOrderperformance calculate_zero_order_performance (void) const
 
virtual FirstOrderperformance calculate_first_order_performance (void) const
 
virtual SecondOrderperformance calculate_second_order_performance (void) const
 
double calculate_generalization_objective (void) const
 
double calculate_generalization_regularization (void) const
 
double calculate_generalization_constraints (void) const
 
virtual double calculate_generalization_performance (void) const
 
double calculate_zero_order_Taylor_approximation (const Vector< double > &) const
 
double calculate_first_order_Taylor_approximation (const Vector< double > &) const
 
double calculate_second_order_Taylor_approximation (const Vector< double > &) const
 
double calculate_performance (const Vector< double > &, const double &) const
 
double calculate_performance_derivative (const Vector< double > &, const double &) const
 
double calculate_performance_second_derivative (const Vector< double > &, const double &) const
 
virtual tinyxml2::XMLDocument * to_XML (void) const
 
virtual void from_XML (const tinyxml2::XMLDocument &)
 
virtual std::string to_string (void) const
 
virtual void save (const std::string &) const
 
virtual void load (const std::string &)
 
virtual std::string write_information (void)
 
void print (void) const
 

Private Attributes

NeuralNetworkneural_network_pointer
 
DataSetdata_set_pointer
 
MathematicalModelmathematical_model_pointer
 
ObjectiveType objective_type
 
RegularizationType regularization_type
 
ConstraintsType constraints_type
 
SumSquaredErrorsum_squared_error_objective_pointer
 
MeanSquaredErrormean_squared_error_objective_pointer
 
RootMeanSquaredErrorroot_mean_squared_error_objective_pointer
 
NormalizedSquaredErrornormalized_squared_error_objective_pointer
 
MinkowskiErrorMinkowski_error_objective_pointer
 
CrossEntropyErrorcross_entropy_error_objective_pointer
 
OutputsIntegralsoutputs_integrals_objective_pointer
 
SolutionsErrorsolutions_error_objective_pointer
 
FinalSolutionsErrorfinal_solutions_error_objective_pointer
 
IndependentParametersErrorindependent_parameters_error_objective_pointer
 
InverseSumSquaredErrorinverse_sum_squared_error_objective_pointer
 
PerformanceTermuser_objective_pointer
 
NeuralParametersNormneural_parameters_norm_regularization_pointer
 
OutputsIntegralsoutputs_integrals_regularization_pointer
 
PerformanceTermuser_regularization_pointer
 
OutputsIntegralsoutputs_integrals_constraints_pointer
 
SolutionsErrorsolutions_error_constraints_pointer
 
FinalSolutionsErrorfinal_solutions_error_constraints_pointer
 
IndependentParametersErrorindependent_parameters_error_constraints_pointer
 
PerformanceTermuser_constraints_pointer
 
bool display
 

Detailed Description

This abstract class represents the concept of performance functional for a neural network. A performance functional is composed of three terms: An performance term, a regularization functional and a constraints functional. Any derived class must implement the calculate_performance(void) method.

Definition at line 62 of file performance_functional.h.

Constructor & Destructor Documentation

OpenNN::PerformanceFunctional::PerformanceFunctional ( void  )
explicit

Default constructor. It creates a performance functional object with all pointers initialized to NULL. It also initializes all the rest of class members to their default values.

Definition at line 27 of file performance_functional.cpp.

OpenNN::PerformanceFunctional::PerformanceFunctional ( PerformanceTerm new_user_objective_pointer)
explicit

Objective term constructor. It creates a performance functional object with a given objective functional. The rest of pointers are initialized to NULL. The other members are set to their default values, but the objective term type, which is set to USER_PERFORMANCE_TERM.

Definition at line 236 of file performance_functional.cpp.

OpenNN::PerformanceFunctional::PerformanceFunctional ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates a performance functional object associated to a neural network object. The rest of pointers are initialized to NULL. It also initializes all the rest of class members to their default values.

Parameters
new_neural_network_pointerPointer to a neural network object.

Definition at line 68 of file performance_functional.cpp.

OpenNN::PerformanceFunctional::PerformanceFunctional ( NeuralNetwork new_neural_network_pointer,
DataSet new_data_set_pointer 
)
explicit

Neural network and data set constructor. It creates a performance functional object associated to a neural network and a data set objects. The rest of pointers are initialized to NULL. It also initializes all the rest of class members to their default values.

Parameters
new_neural_network_pointerPointer to a neural network object.
new_data_set_pointerPointer to a data set object.

Definition at line 110 of file performance_functional.cpp.

OpenNN::PerformanceFunctional::PerformanceFunctional ( NeuralNetwork new_neural_network_pointer,
MathematicalModel new_mathematical_model_pointer 
)
explicit

Neural network and mathematical model constructor. It creates a performance functional object associated to a neural network and a mathematical model objects. The rest of pointers are initialized to NULL. It also initializes all the rest of class members to their default values.

Parameters
new_neural_network_pointerPointer to a neural network object.
new_mathematical_model_pointerPointer to a mathematical model object.

Definition at line 153 of file performance_functional.cpp.

OpenNN::PerformanceFunctional::PerformanceFunctional ( NeuralNetwork new_neural_network_pointer,
MathematicalModel new_mathematical_model_pointer,
DataSet new_data_set_pointer 
)
explicit

Neural network, mathematical model and data set constructor. It creates a performance functional object associated to a neural network, a mathematical model and a data set objects. The rest of pointers are initialized to NULL. It also initializes all the rest of class members to their default values.

Parameters
new_neural_network_pointerPointer to a neural network object.
new_mathematical_model_pointerPointer to a mathematical model object.
new_data_set_pointerPointer to a data set object.

Definition at line 196 of file performance_functional.cpp.

OpenNN::PerformanceFunctional::PerformanceFunctional ( const std::string &  file_name)
explicit

File constructor. It creates a performance functional object by loading its members from an XML-type file. Please be careful with the format of that file, which is specified in the OpenNN manual.

Parameters
file_nameName of performance functional file.

Definition at line 276 of file performance_functional.cpp.

OpenNN::PerformanceFunctional::PerformanceFunctional ( const tinyxml2::XMLDocument &  performance_functional_document)
explicit

XML constructor. It creates a performance functional object by loading its members from an XML document->

Parameters
performance_functional_documentPointer to a TinyXML document containing the performance functional data.

Definition at line 317 of file performance_functional.cpp.

OpenNN::PerformanceFunctional::PerformanceFunctional ( const PerformanceFunctional other_performance_functional)

Copy constructor. It creates a copy of an existing performance functional object.

Parameters
other_performance_functionalPerformance functional object to be copied.
Todo:

Definition at line 359 of file performance_functional.cpp.

OpenNN::PerformanceFunctional::~PerformanceFunctional ( void  )
virtual

Destructor. It deletes the objective, regularization and constraints terms.

Definition at line 590 of file performance_functional.cpp.

Member Function Documentation

double OpenNN::PerformanceFunctional::calculate_constraints ( void  ) const

Returns the constraints evaluation, according to the respective constraints type used in the performance functional expression.

Definition at line 3166 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_constraints ( const Vector< double > &  parameters) const

Returns the constraints evaluation, according to the respective constraints type used in the performance functional expression.

Definition at line 3240 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_constraints_gradient ( void  ) const

Returns the gradient of the constraints, according to the objective type. That gradient is the vector of partial derivatives of the constraints with respect to the parameters. The size is thus the number of parameters.

Definition at line 4260 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_constraints_gradient ( const Vector< double > &  parameters) const

Returns the gradient of the constraints, according to the objective type. That gradient is the vector of partial derivatives of the constraints with respect to the parameters. The size is thus the number of parameters.

Definition at line 4337 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_constraints_Hessian ( void  ) const

Returns the Hessian of the constraints, according to the constraints type. That Hessian is the matrix of second partial derivatives of the constraints with respect to the parameters. That matrix is symmetric, with size the number of parameters.

Definition at line 4784 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_constraints_Hessian ( const Vector< double > &  ) const

Returns the Hessian of the constraints, according to the constraints type. That Hessian is the matrix of second partial derivatives of the constraints with respect to the parameters. That matrix is symmetric, with size the number of parameters.

Todo:

Definition at line 4862 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_constraints_terms ( void  ) const
Todo:

Definition at line 3517 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_constraints_terms_Jacobian ( void  ) const

Returns the Jacobian of the constraints terms function, according to the constraints type used in the performance functional expression. Note that this function is only defined when the objective can be expressed as a sum of squared terms. The Jacobian elements are the partial derivatives of a single term with respect to a single parameter. The number of rows in the Jacobian matrix are the number of parameters, and the number of columns the number of terms composing the constraints.

Definition at line 3809 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_first_order_Taylor_approximation ( const Vector< double > &  parameters) const

Returns the Taylor approximation of the performance function at some point near the parameters. The order of the approximation here is one, i.e., both the performance value and the performance gradient are used.

Parameters
parametersApproximation point.

Definition at line 5552 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_generalization_performance ( void  ) const
virtual

Calculates the generalization performance, as the sum of the objective and the regularization terms.

Definition at line 5215 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_gradient ( const Vector< double > &  parameters) const

Returns the performance gradient for a given vector of parameters. It does not set that vector of parameters to the neural network.

Parameters
parametersVector of parameters for the neural network associated to the performance functional.

Definition at line 5262 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_Hessian ( void  ) const

Returns the default objective function Hessian matrix, which is computed as the sum of the objective, regularization and constraints Hessians.

Definition at line 5301 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_Hessian ( const Vector< double > &  parameters) const

Returns which would be the objective function Hessian of a neural network for an hypothetical vector of parameters. It does not set that vector of parameters to the neural network.

Parameters
parametersVector of potential parameters for the neural network associated to this performance functional.

Definition at line 5323 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_inverse_Hessian ( void  ) const
virtual

Returns inverse matrix of the Hessian. It first computes the Hessian matrix and then computes its inverse.

Todo:

Definition at line 5419 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_objective ( void  ) const

Returns the objective evaluation, according to the respective objective type used in the performance functional expression.

Definition at line 2814 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_objective ( const Vector< double > &  parameters) const

Returns the objective evaluation, according to the respective objective type used in the performance functional expression.

Definition at line 2930 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_objective_gradient ( void  ) const

Returns the gradient of the objective, according to the objective type. That gradient is the vector of partial derivatives of the objective with respect to the parameters. The size is thus the number of parameters.

Definition at line 3892 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_objective_gradient ( const Vector< double > &  parameters) const

Returns the gradient of the objective, according to the objective type. That gradient is the vector of partial derivatives of the objective with respect to the parameters. The size is thus the number of parameters.

Definition at line 4011 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_objective_Hessian ( void  ) const

Returns the Hessian of the objective, according to the objective type. That Hessian is the matrix of second partial derivatives of the objective with respect to the parameters. That matrix is symmetric, with size the number of parameters.

Definition at line 4414 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_objective_Hessian ( const Vector< double > &  parameters) const

Returns the Hessian of the objective, according to the objective type. That Hessian is the matrix of second partial derivatives of the objective with respect to the parameters. That matrix is symmetric, with size the number of parameters.

Todo:

Definition at line 4534 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_objective_terms ( void  ) const

Returns the evaluation of all the objective terms, according to the respective objective type used in the performance functional expression. Note that this function is only defined when the objective can be expressed as a sum of squared terms.

Definition at line 3315 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_objective_terms_Jacobian ( void  ) const

Returns the Jacobian of the objective terms function, according to the objective type used in the performance functional expression. Note that this function is only defined when the objective can be expressed as a sum of squared terms. The Jacobian elements are the partial derivatives of a single term with respect to a single parameter. The number of rows in the Jacobian matrix are the number of parameters, and the number of columns the number of terms composing the objective.

Definition at line 3603 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_performance ( void  ) const

Calculates the evaluation value of the performance functional, as the sum of the objective, regularization and constraints functionals.

Definition at line 4938 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_performance ( const Vector< double > &  parameters) const

Returns the performance of a neural network for a given vector of parameters. It does not set that vector of parameters to the neural network.

Parameters
parametersVector of parameters for the neural network associated to the performance functional.

Definition at line 4960 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_performance ( const Vector< double > &  direction,
const double &  rate 
) const

Returns the value of the performance function at some step along some direction.

Parameters
directionDirection vector.
rateStep value.

Definition at line 5638 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_performance_derivative ( const Vector< double > &  direction,
const double &  rate 
) const

Returns the derivative of the performance function at some step along some direction.

Parameters
directionDirection vector.
rateStep value.

Definition at line 5653 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_performance_second_derivative ( const Vector< double > &  direction,
const double &  rate 
) const

Returns the second derivative of the performance function at some step along some direction.

Parameters
directionDirection vector.
rateStep value.

Definition at line 5677 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_regularization ( void  ) const

Returns the regularization evaluation, according to the respective regularization type used in the performance functional expression.

Definition at line 3046 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_regularization ( const Vector< double > &  parameters) const

Returns the regularization evaluation, according to the respective regularization type used in the performance functional expression.

Definition at line 3106 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_regularization_gradient ( void  ) const

Returns the gradient of the regularization, according to the regularization type. That gradient is the vector of partial derivatives of the regularization with respect to the parameters. The size is thus the number of parameters.

Definition at line 4130 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_regularization_gradient ( const Vector< double > &  parameters) const

Returns the gradient of the regularization, according to the regularization type. That gradient is the vector of partial derivatives of the regularization with respect to the parameters. The size is thus the number of parameters.

Definition at line 4195 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_regularization_Hessian ( void  ) const

Returns the Hessian of the regularization, according to the regularization type. That Hessian is the matrix of second partial derivatives of the regularization with respect to the parameters. That matrix is symmetric, with size the number of parameters.

Definition at line 4653 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_regularization_Hessian ( const Vector< double > &  ) const

Returns the Hessian of the regularization, according to the regularization type. That Hessian is the matrix of second partial derivatives of the regularization with respect to the parameters. That matrix is symmetric, with size the number of parameters.

Todo:

Definition at line 4719 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_regularization_terms ( void  ) const
Todo:

Definition at line 3456 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_regularization_terms_Jacobian ( void  ) const

Returns the Jacobian of the regularization terms function, according to the regularization type used in the performance functional expression. Note that this function is only defined when the objective can be expressed as a sum of squared terms. The Jacobian elements are the partial derivatives of a single term with respect to a single parameter. The number of rows in the Jacobian matrix are the number of parameters, and the number of columns the number of terms composing the regularization.

Definition at line 3745 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_second_order_Taylor_approximation ( const Vector< double > &  parameters) const

Returns the Taylor approximation of the performance function at some point near the parameters. The order of the approximation here is two, i.e., the performance value, the performance gradient and the performance Hessian are used.

Parameters
parametersApproximation point.

Definition at line 5591 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_terms ( void  ) const

Evaluates the objective, regularization and constraints terms functions, and returns the total performance terms as the assembly of that three vectors.

Definition at line 5358 of file performance_functional.cpp.

Matrix< double > OpenNN::PerformanceFunctional::calculate_terms_Jacobian ( void  ) const
Todo:

Definition at line 5384 of file performance_functional.cpp.

Vector< double > OpenNN::PerformanceFunctional::calculate_vector_dot_Hessian ( const Vector< double > &  vector) const
virtual

Returns the default product of some vector with the objective function Hessian matrix, which is computed using numerical differentiation.

Parameters
vectorVector in the dot product.
Todo:

Definition at line 5452 of file performance_functional.cpp.

double OpenNN::PerformanceFunctional::calculate_zero_order_Taylor_approximation ( const Vector< double > &  ) const

Returns the Taylor approximation of the performance function at some point near the parameters. The order of the approximation here is zero, i.e., only the performance value is used.

Definition at line 5540 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::check_performance_terms ( void  ) const

Throws an exception if the performance functional has not got any objective, regularization or constraints terms.

Definition at line 766 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::destruct_constraints ( void  )

This method deletes the constraints term object. It also sets the constraints term type to NONE and the corresponding flag to false.

Definition at line 2779 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::destruct_objective ( void  )

This method deletes the objective term object. It also sets the objective term type to NONE and the corresponding flag to false.

Definition at line 2723 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::destruct_regularization ( void  )

This method deletes the regularization term object. It also sets the regularization term type to NONE and the corresponding flag to false.

Definition at line 2760 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::from_XML ( const tinyxml2::XMLDocument &  document)
virtual

Sets the performance functional member data from an XML document.

Parameters
documentPointer to a TinyXML document with the performance functional data.

Definition at line 6115 of file performance_functional.cpp.

CrossEntropyError * OpenNN::PerformanceFunctional::get_cross_entropy_error_objective_pointer ( void  ) const

Returns a pointer to the cross entropy error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 929 of file performance_functional.cpp.

const bool & OpenNN::PerformanceFunctional::get_display ( void  ) const

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 1678 of file performance_functional.cpp.

FinalSolutionsError * OpenNN::PerformanceFunctional::get_final_solutions_error_constraints_pointer ( void  ) const

Returns a pointer to the final solutions error which is used as constraints. If that object does not exists, an exception is thrown.

Definition at line 1266 of file performance_functional.cpp.

FinalSolutionsError * OpenNN::PerformanceFunctional::get_final_solutions_error_objective_pointer ( void  ) const

Returns a pointer to the final solutions error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 1014 of file performance_functional.cpp.

IndependentParametersError * OpenNN::PerformanceFunctional::get_independent_parameters_error_constraints_pointer ( void  ) const

Returns a pointer to the independent parameters error which is used as constraints. If that object does not exists, an exception is thrown.

Definition at line 1294 of file performance_functional.cpp.

IndependentParametersError * OpenNN::PerformanceFunctional::get_independent_parameters_error_objective_pointer ( void  ) const

Returns a pointer to the independent parameters error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 1042 of file performance_functional.cpp.

InverseSumSquaredError * OpenNN::PerformanceFunctional::get_inverse_sum_squared_error_objective_pointer ( void  ) const

Returns a pointer to the inverse sum squared error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 1070 of file performance_functional.cpp.

MeanSquaredError * OpenNN::PerformanceFunctional::get_mean_squared_error_objective_pointer ( void  ) const

Returns a pointer to the mean squared error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 817 of file performance_functional.cpp.

MinkowskiError * OpenNN::PerformanceFunctional::get_Minkowski_error_objective_pointer ( void  ) const

Returns a pointer to the Minkowski error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 901 of file performance_functional.cpp.

NeuralParametersNorm * OpenNN::PerformanceFunctional::get_neural_parameters_norm_regularization_pointer ( void  ) const

Returns a pointer to the neural parameters norm functional which is used as regularization. If that object does not exists, an exception is thrown.

Definition at line 1126 of file performance_functional.cpp.

NormalizedSquaredError * OpenNN::PerformanceFunctional::get_normalized_squared_error_objective_pointer ( void  ) const

Returns a pointer to the normalized squared error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 873 of file performance_functional.cpp.

OutputsIntegrals * OpenNN::PerformanceFunctional::get_outputs_integrals_constraints_pointer ( void  ) const

Returns a pointer to the outputs integrals which is used as constraints. If that object does not exists, an exception is thrown.

Definition at line 1210 of file performance_functional.cpp.

OutputsIntegrals * OpenNN::PerformanceFunctional::get_outputs_integrals_objective_pointer ( void  ) const

Returns a pointer to the outputs integrals which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 958 of file performance_functional.cpp.

OutputsIntegrals * OpenNN::PerformanceFunctional::get_outputs_integrals_regularization_pointer ( void  ) const

Returns a pointer to the outputs integrals functional which is used as regularization. If that object does not exists, an exception is thrown.

Definition at line 1154 of file performance_functional.cpp.

RootMeanSquaredError * OpenNN::PerformanceFunctional::get_root_mean_squared_error_objective_pointer ( void  ) const

Returns a pointer to the root mean squared error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 845 of file performance_functional.cpp.

SolutionsError * OpenNN::PerformanceFunctional::get_solutions_error_constraints_pointer ( void  ) const

Returns a pointer to the solutions error which is used as constraints. If that object does not exists, an exception is thrown.

Definition at line 1238 of file performance_functional.cpp.

SolutionsError * OpenNN::PerformanceFunctional::get_solutions_error_objective_pointer ( void  ) const

Returns a pointer to the solutions error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 986 of file performance_functional.cpp.

SumSquaredError * OpenNN::PerformanceFunctional::get_sum_squared_error_objective_pointer ( void  ) const

Returns a pointer to the sum squared error which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 789 of file performance_functional.cpp.

PerformanceTerm * OpenNN::PerformanceFunctional::get_user_constraints_pointer ( void  ) const

Returns a pointer to the user constraints functional. If that object does not exists, an exception is thrown.

Definition at line 1322 of file performance_functional.cpp.

PerformanceTerm * OpenNN::PerformanceFunctional::get_user_objective_pointer ( void  ) const

Returns a pointer to the user performance term which is used as objective. If that object does not exists, an exception is thrown.

Definition at line 1098 of file performance_functional.cpp.

PerformanceTerm * OpenNN::PerformanceFunctional::get_user_regularization_pointer ( void  ) const

Returns a pointer to the user regularization functional. If that object does not exists, an exception is thrown.

Definition at line 1182 of file performance_functional.cpp.

bool OpenNN::PerformanceFunctional::has_data_set ( void  ) const

Returns true if this performance functional has a data set associated, and false otherwise.

Definition at line 667 of file performance_functional.cpp.

bool OpenNN::PerformanceFunctional::has_generalization ( void  ) const

Returns true if this performance functional has a generalization method defined, and false otherwise.

Definition at line 685 of file performance_functional.cpp.

bool OpenNN::PerformanceFunctional::has_mathematical_model ( void  ) const

Returns true if this performance functional has a mathematical model associated, and false otherwise.

Definition at line 649 of file performance_functional.cpp.

bool OpenNN::PerformanceFunctional::has_neural_network ( void  ) const

Returns true if this performance functional has a neural network associated, and false otherwise.

Definition at line 631 of file performance_functional.cpp.

bool OpenNN::PerformanceFunctional::is_sum_squared_terms ( void  ) const

Returns true if the performance functional can be expressed as the sum of squared terms. Only those performance functionals are suitable for the Levenberg-Marquardt training algorithm.

Definition at line 710 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::load ( const std::string &  file_name)
virtual

Loads a default performance functional XML-type file.

Parameters
file_nameName of default XML-type performance functional file.

Definition at line 6720 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::save ( const std::string &  file_name) const
virtual

Saves to a XML-type file a string representation of the performance functional object.

Parameters
file_nameName of XML-type performance functional file.

Definition at line 6698 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_constraints_type ( const ConstraintsType new_constraints_type)

Creates a new constraints term inside the performance functional of a given performance term type.

Parameters
new_constraints_typeType of constraints term to be created.

Definition at line 2659 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_constraints_type ( const std::string &  new_constraints_type)

Sets a new type for the constraints term from a string.

Parameters
new_constraints_typeString with the type of constraints term.

Definition at line 2444 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_data_set_pointer ( DataSet new_data_set_pointer)

Sets a new data set on which it will be measured the performance functional.

Parameters
new_data_set_pointerPointer to an external data set object.

Definition at line 2089 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_display ( const bool &  new_display)

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_displayDisplay value.

Definition at line 2490 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_mathematical_model_pointer ( MathematicalModel new_mathematical_model_pointer)

Sets a new mathematical model on which it will be measured the performance functional.

Parameters
new_mathematical_model_pointerPointer to an external mathematical model object.

Definition at line 1889 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_neural_network_pointer ( NeuralNetwork new_neural_network_pointer)

Sets a pointer to a multilayer perceptron object which is to be associated to the performance functional.

Parameters
new_neural_network_pointerPointer to a neural network object to be associated to the performance functional.

Definition at line 1689 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_objective_type ( const ObjectiveType new_objective_type)

Creates a new objective term inside the performance functional of a given performance term type.

Parameters
new_objective_typeType of objective term to be created.

Definition at line 2501 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_objective_type ( const std::string &  new_objective_type)

Sets a new type for the objective term from a string.

Parameters
new_objective_typeString with the type of objective term.

Definition at line 2344 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_regularization_type ( const RegularizationType new_regularization_type)

Creates a new regularization term inside the performance functional of a given performance term type.

Parameters
new_regularization_typeType of regularization term to be created.

Definition at line 2607 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_regularization_type ( const std::string &  new_regularization_type)

Sets a new type for the regularization term from a string.

Parameters
new_regularization_typeString with the type of regularization term.

Definition at line 2412 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_user_constraints_pointer ( PerformanceTerm new_user_constraints_pointer)

Sets the constraints term to be a specialized one provided by the user.

Parameters
new_user_constraints_pointerPointer to a performance term object.

Definition at line 2319 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_user_objective_pointer ( PerformanceTerm new_user_objective_pointer)

Sets the objective term to be a specialized one provided by the user.

Parameters
new_user_objective_pointerPointer to a performance term object.

Definition at line 2289 of file performance_functional.cpp.

void OpenNN::PerformanceFunctional::set_user_regularization_pointer ( PerformanceTerm new_user_regularization_pointer)

Sets the regularization term to be a specialized one provided by the user.

Parameters
new_user_regularization_pointerPointer to a performance term object.

Definition at line 2304 of file performance_functional.cpp.

tinyxml2::XMLDocument * OpenNN::PerformanceFunctional::to_XML ( void  ) const
virtual

Serializes a default performance functional object into a XML document of the TinyXML library. See the OpenNN manual for more information about the format of this element.

Definition at line 5700 of file performance_functional.cpp.

std::string OpenNN::PerformanceFunctional::write_information ( void  )
virtual

Returns any useful information about the objective function during training. By default it is an empty string.

Definition at line 6744 of file performance_functional.cpp.


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