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

#include <final_solutions_error.h>

Inheritance diagram for OpenNN::FinalSolutionsError:
OpenNN::PerformanceTerm

Public Member Functions

 FinalSolutionsError (void)
 
 FinalSolutionsError (NeuralNetwork *)
 
 FinalSolutionsError (MathematicalModel *)
 
 FinalSolutionsError (NeuralNetwork *, MathematicalModel *)
 
 FinalSolutionsError (const tinyxml2::XMLDocument &)
 
 FinalSolutionsError (const FinalSolutionsError &)
 
virtual ~FinalSolutionsError (void)
 
FinalSolutionsErroroperator= (const FinalSolutionsError &)
 
bool operator== (const FinalSolutionsError &) const
 
const Vector< double > & get_final_solutions_errors_weights (void) const
 
const Vector< double > & get_target_final_solutions (void) const
 
void set (void)
 
void set (NeuralNetwork *)
 
void set (MathematicalModel *)
 
void set (NeuralNetwork *, MathematicalModel *)
 
void set_mathematical_model_pointer (MathematicalModel *)
 
void set_final_solutions_errors_weights (const Vector< double > &)
 
void set_final_solution_error_weight (const size_t &, const double &)
 
void set_target_final_solutions (const Vector< double > &)
 
void set_target_final_solution (const size_t &, const double &)
 
void set_default (void)
 
void check (void) const
 
double calculate_performance (void) const
 
double calculate_performance (const Vector< double > &) const
 
std::string write_performance_term_type (void) const
 
std::string write_information (void) const
 
tinyxml2::XMLDocument * to_XML (void) const
 
void from_XML (const tinyxml2::XMLDocument &)
 
- Public Member Functions inherited from OpenNN::PerformanceTerm
 PerformanceTerm (void)
 
 PerformanceTerm (NeuralNetwork *)
 
 PerformanceTerm (DataSet *)
 
 PerformanceTerm (MathematicalModel *)
 
 PerformanceTerm (NeuralNetwork *, DataSet *)
 
 PerformanceTerm (NeuralNetwork *, MathematicalModel *)
 
 PerformanceTerm (NeuralNetwork *, MathematicalModel *, DataSet *)
 
 PerformanceTerm (const tinyxml2::XMLDocument &)
 
 PerformanceTerm (const PerformanceTerm &)
 
virtual ~PerformanceTerm (void)
 
virtual PerformanceTermoperator= (const PerformanceTerm &)
 
virtual bool operator== (const PerformanceTerm &) const
 
NeuralNetworkget_neural_network_pointer (void) const
 
MathematicalModelget_mathemtaical_model_pointer (void) const
 
DataSetget_data_set_pointer (void) const
 
NumericalDifferentiationget_numerical_differentiation_pointer (void) const
 
const bool & get_display (void) const
 
bool has_neural_network (void) const
 
bool has_mathematical_model (void) const
 
bool has_data_set (void) const
 
bool has_numerical_differentiation (void) const
 
virtual void set (DataSet *)
 
virtual void set (NeuralNetwork *, DataSet *)
 
virtual void set (NeuralNetwork *, MathematicalModel *, DataSet *)
 
void set (const PerformanceTerm &)
 
virtual void set_neural_network_pointer (NeuralNetwork *)
 
virtual void set_data_set_pointer (DataSet *)
 
void set_numerical_differentiation_pointer (NumericalDifferentiation *)
 
void set_display (const bool &)
 
void construct_numerical_differentiation (void)
 
void delete_numerical_differentiation_pointer (void)
 
Vector< Vector< double > > calculate_layers_delta (const Vector< Vector< double > > &, const Vector< double > &) const
 
Vector< Vector< double > > calculate_layers_delta (const Vector< Vector< double > > &, const Vector< double > &, const Vector< double > &) const
 
Matrix< Matrix< double > > calculate_interlayers_Delta (const Vector< Vector< double > > &, const Vector< Vector< double > > &, const Matrix< Matrix< double > > &, const Vector< double > &, const Matrix< double > &, const Vector< Vector< double > > &) const
 
Vector< double > calculate_point_gradient (const Vector< double > &, const Vector< Vector< double > > &, const Vector< Vector< double > > &) const
 
Vector< double > calculate_point_gradient (const Vector< Matrix< double > > &, const Vector< Vector< double > > &) const
 
Matrix< double > calculate_point_Hessian (const Vector< Vector< double > > &, const Vector< Vector< Vector< double > > > &, const Matrix< Matrix< double > > &, const Vector< Vector< double > > &, const Matrix< Matrix< double > > &) const
 
virtual double calculate_generalization_performance (void) const
 
virtual Vector< double > calculate_gradient (void) const
 
virtual Vector< double > calculate_gradient (const Vector< double > &) const
 
virtual Matrix< double > calculate_Hessian (void) const
 
virtual Matrix< double > calculate_Hessian (const Vector< double > &) const
 
virtual Vector< double > calculate_terms (void) const
 
virtual Vector< double > calculate_terms (const Vector< double > &) const
 
virtual Matrix< double > calculate_terms_Jacobian (void) const
 
virtual PerformanceTerm::FirstOrderTerms calculate_first_order_terms (void) const
 
virtual std::string to_string (void) const
 
size_t calculate_Kronecker_delta (const size_t &, const size_t &) const
 

Private Attributes

Vector< double > target_final_solutions
 
Vector< double > final_solutions_errors_weights
 

Additional Inherited Members

- Protected Attributes inherited from OpenNN::PerformanceTerm
NeuralNetworkneural_network_pointer
 
DataSetdata_set_pointer
 
MathematicalModelmathematical_model_pointer
 
NumericalDifferentiationnumerical_differentiation_pointer
 
bool display
 

Detailed Description

This class represents the final solutions error constraints functional. The final solutions error is measured on a mathematical model. This constraints functional often appears in optimal control problems.

Definition at line 43 of file final_solutions_error.h.

Constructor & Destructor Documentation

OpenNN::FinalSolutionsError::FinalSolutionsError ( void  )
explicit

Default constructor. It creates a final solutions error performance term not associated to any neural network and not measured on any mathematical model. It also initializes all the rest of class members to their default values.

Definition at line 27 of file final_solutions_error.cpp.

OpenNN::FinalSolutionsError::FinalSolutionsError ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates a final solutions error performance term associated to a neural network but not measured on any mathematical model. 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 43 of file final_solutions_error.cpp.

OpenNN::FinalSolutionsError::FinalSolutionsError ( MathematicalModel new_mathematical_model_pointer)
explicit

Mathematical model constructor. It creates a final solutions error performance term not associated to any neural network but to be measured on a given mathematical model. It also initializes all the rest of class members to their default values.

Parameters
new_mathematical_model_pointerPointer to a mathematical model object.

Definition at line 59 of file final_solutions_error.cpp.

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

Neural network and mathematical model constructor. It creates a final solutions error performance term object associated to a given neural network and to be measured on a given mathematical model. 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 76 of file final_solutions_error.cpp.

OpenNN::FinalSolutionsError::FinalSolutionsError ( const tinyxml2::XMLDocument &  final_state_error_document)
explicit

XML constructor. It creates a final solutions error performance term neither associated to a neural network nor to a mathematical model. It also sets the rest of members with values from a XML document.

Parameters
final_state_error_documentPointer to a TinyXML with the member data.

Definition at line 92 of file final_solutions_error.cpp.

OpenNN::FinalSolutionsError::FinalSolutionsError ( const FinalSolutionsError other_final_solutions_error)

Copy constructor. It creates a copy of an existing final solutions error object.

Parameters
other_final_solutions_errorFinal solutions error object to be copied.

Definition at line 109 of file final_solutions_error.cpp.

Member Function Documentation

void OpenNN::FinalSolutionsError::check ( void  ) const
virtual

Checks that there are a neural network and a mathematical model associated to the sum squared error, and that the number of dependent variables in the mathematical model is equal to the number of target final solutions in the performance term. If some of the above conditions is not hold, the method throws an exception.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 389 of file final_solutions_error.cpp.

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

Loads a final solutions error object from a XML document.

Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 612 of file final_solutions_error.cpp.

bool OpenNN::FinalSolutionsError::operator== ( const FinalSolutionsError other_final_solutions_error) const

Equal to operator.

Todo:

Definition at line 174 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set ( void  )
virtual

Sets the neural network and mathematical model pointers to NULL. It also deletes the numerical differentiation pointer inside this class. Finally it sets the rest of members to their default values.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 220 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set ( NeuralNetwork )
virtual
Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 238 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set ( MathematicalModel )
virtual
Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 247 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set ( NeuralNetwork ,
MathematicalModel  
)
virtual
Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 256 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set_default ( void  )
virtual

Sets the default variables of this object.

  • Target final solutions: 0 for all dependent variables.
  • Final solutions errors weights: 1 for all dependent variables.
  • Display: True.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 362 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set_final_solution_error_weight ( const size_t &  i,
const double &  new_final_solution_error_weight 
)

Sets a new weight value for a single error in the final solutions.

Parameters
iIndex of dependent variable.
new_final_solution_error_weightWeight value for the error of that dependent variable.

Definition at line 324 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set_final_solutions_errors_weights ( const Vector< double > &  new_final_solutions_errors_weights)

Sets new weight values for each error in the final solutions.

Parameters
new_final_solutions_errors_weightsWeight values. The size of this vector must be equal to the nuber of dependent variables in the mathematical model.

Definition at line 312 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set_mathematical_model_pointer ( MathematicalModel new_mathematical_model_pointer)
virtual

Associates this final solutions error object with a given mathematical model object.

Parameters
new_mathematical_model_pointerPointer to a mathematical model object.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 292 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set_target_final_solution ( const size_t &  i,
const double &  new_target_final_solution 
)

Sets the desired final state of a single dependent variable.

Parameters
iIndex of dependent variable.
new_target_final_solutionDesired final value of that dependent variable.

Definition at line 347 of file final_solutions_error.cpp.

void OpenNN::FinalSolutionsError::set_target_final_solutions ( const Vector< double > &  new_target_final_solutions)

Sets the desired final states for each dependent variable.

Parameters
new_target_final_solutionsDesired final values. The size of this vector must be equal to the number of dependent variables in the mathematical model.

Definition at line 335 of file final_solutions_error.cpp.

std::string OpenNN::FinalSolutionsError::write_information ( void  ) const
virtual

Returns a string with the default information of the performance term. It will be used by the training strategy to monitor the training process. By default this information is empty.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 514 of file final_solutions_error.cpp.

Member Data Documentation

Vector<double> OpenNN::FinalSolutionsError::final_solutions_errors_weights
private

Weight value for each error on the final solution. The size of this vector must be equal to the number of dependent variablese in the mathematical model.

Definition at line 142 of file final_solutions_error.h.

Vector<double> OpenNN::FinalSolutionsError::target_final_solutions
private

Desired final values for the dependent variables. The size of this vector must be equal to the number of dependent variablese in the mathematical model.

Definition at line 137 of file final_solutions_error.h.


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