OpenNN::SolutionsError Class Reference

#include <solutions_error.h>

Inheritance diagram for OpenNN::SolutionsError:

OpenNN::PerformanceTerm

List of all members.

Public Types

enum  SolutionsErrorMethod { SolutionsErrorSum, SolutionsErrorIntegral }

Public Member Functions

 SolutionsError (void)
 SolutionsError (NeuralNetwork *)
 SolutionsError (MathematicalModel *)
 SolutionsError (NeuralNetwork *, MathematicalModel *)
 SolutionsError (TiXmlElement *)
 SolutionsError (const SolutionsError &)
SolutionsErroroperator= (const SolutionsError &)
bool operator== (const SolutionsError &) const
virtual ~SolutionsError (void)
const SolutionsErrorMethodget_solutions_error_method (void) const
std::string write_solutions_error_method (void) const
const Vector< double > & get_solutions_errors_weights (void) const
const double & get_solution_error_weight (const unsigned int &) const
void set (const SolutionsError &)
void set_solutions_error_method (const SolutionsErrorMethod &)
void set_solutions_error_method (const std::string &)
void set_solutions_errors_weights (const Vector< double > &)
void set_solution_error_weight (const unsigned int &, const double &)
void set_default (void)
virtual Matrix< double > calculate_target_dependent_variables (const Matrix< double > &) const
void check (void) const
double calculate_solutions_error_sum (void) const
double calculate_solutions_error_integral (void) const
virtual double calculate_evaluation (void) const
virtual double calculate_evaluation (const Vector< double > &) const
std::string write_performance_term_type (void) const
std::string write_information (void) const
virtual void print (void) const
TiXmlElement * to_XML (void) const
void from_XML (TiXmlElement *)

Protected Attributes

NumericalIntegration numerical_integration
SolutionsErrorMethod solutions_error_method
Vector< double > solutions_errors_weights


Detailed Description

This class implements a performance term called solutions error. This performance term is measured on a mathematical model. It computes the difference between the solution from a mathematical model and a given target solution. This type of functional is very used in optimal control problems, in which the neural network represents the control variables. The first and second derivatives of this type of performance term are calculated with numerical differentiation.

Definition at line 34 of file solutions_error.h.


Member Enumeration Documentation

Enumeration of the different methods to compute the errors between the mathematical model solutions and the target solutions.

Definition at line 79 of file solutions_error.h.


Constructor & Destructor Documentation

OpenNN::SolutionsError::SolutionsError ( void   )  [explicit]

Default constructor. It creates a 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 44 of file solutions_error.cpp.

OpenNN::SolutionsError::SolutionsError ( NeuralNetwork new_neural_network_pointer  )  [explicit]

Neural network constructor. It creates a solutions error associated to a neural network, but not to a . It also initializes all the rest of class members to their default values.

Parameters:
new_neural_network_pointer Pointer to a neural network object.

Definition at line 59 of file solutions_error.cpp.

OpenNN::SolutionsError::SolutionsError ( MathematicalModel new_mathematical_model_pointer  )  [explicit]

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

Parameters:
new_mathematical_model_pointer Pointer to a mathematical model object.

Definition at line 75 of file solutions_error.cpp.

OpenNN::SolutionsError::SolutionsError ( NeuralNetwork new_neural_network_pointer,
MathematicalModel new_mathematical_model_pointer 
) [explicit]

Neural network and mathematical model constructor. It creates a solutions error functional associated to a neural network and measured on a mathematical model. It also initializes all the rest of class members to their default values.

Parameters:
new_neural_network_pointer Pointer to a neural network object.
new_mathematical_model_pointer Pointer to a mathematical model object.

Definition at line 92 of file solutions_error.cpp.

OpenNN::SolutionsError::SolutionsError ( TiXmlElement *  solutions_error_element  )  [explicit]

xml constructor. It creates a 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 with values taken from a Tiny XML element.

Parameters:
solutions_error_element XML element containing the class members.

Definition at line 108 of file solutions_error.cpp.

OpenNN::SolutionsError::SolutionsError ( const SolutionsError other_solutions_error  ) 

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

Parameters:
other_solutions_error Solutions error object to be copied.

Definition at line 123 of file solutions_error.cpp.

OpenNN::SolutionsError::~SolutionsError ( void   )  [virtual]

Destructor. This destructor does not delete any object. The numerical differentiation object is deleted by the performance term destructor.

Definition at line 138 of file solutions_error.cpp.


Member Function Documentation

SolutionsError & OpenNN::SolutionsError::operator= ( const SolutionsError other_solutions_error  ) 

Assignment operator. It assigns to this solutions error object the members from another solutions error object.

Parameters:
other_solutions_error Solutions error object to be copied.

Definition at line 151 of file solutions_error.cpp.

bool OpenNN::SolutionsError::operator== ( const SolutionsError other_solutions_error  )  const

Equal to operator. It compares this object to another object, and returns true if both have the same member data, and false otherwise.

Definition at line 176 of file solutions_error.cpp.

const SolutionsError::SolutionsErrorMethod & OpenNN::SolutionsError::get_solutions_error_method ( void   )  const

This method returns the method for computing the solutions error.

Definition at line 199 of file solutions_error.cpp.

std::string OpenNN::SolutionsError::write_solutions_error_method ( void   )  const

This method returns a string with the name of the method for computing the solutions error.

Definition at line 209 of file solutions_error.cpp.

const Vector< double > & OpenNN::SolutionsError::get_solutions_errors_weights ( void   )  const

This method returns the weights for every single solution error, corresponding to a dependent variable.

Definition at line 236 of file solutions_error.cpp.

const double & OpenNN::SolutionsError::get_solution_error_weight ( const unsigned int &  i  )  const

This method returns the weight for a single solution error, corresponding to a dependent variable.

Definition at line 246 of file solutions_error.cpp.

void OpenNN::SolutionsError::set ( const SolutionsError other_solutions_error  ) 

This method sets to this object the data from another object of the same class.

Parameters:
other_solutions_error Solutions error object to be copied.

Definition at line 257 of file solutions_error.cpp.

void OpenNN::SolutionsError::set_solutions_error_method ( const SolutionsErrorMethod new_solutions_error_method  ) 

This method sets a new method for calculating the error between the solution of a mathematical model and a target solution.

Parameters:
new_solutions_error_method Method for evaluating this performance term.

Definition at line 281 of file solutions_error.cpp.

void OpenNN::SolutionsError::set_solutions_error_method ( const std::string &  new_solutions_error_method  ) 

This method sets a new solutions error method from a string with that method's name.

Parameters:
new_solutions_error_method String with the name of the method.

Definition at line 292 of file solutions_error.cpp.

void OpenNN::SolutionsError::set_solutions_errors_weights ( const Vector< double > &  new_solutions_errors_weights  ) 

This method sets new weights for the solution error of every dependent variable.

Parameters:
new_solutions_errors_weights Weights for the errors between the dependent variable solutions and the corresponding target solutions.

Definition at line 320 of file solutions_error.cpp.

void OpenNN::SolutionsError::set_solution_error_weight ( const unsigned int &  i,
const double &  new_solution_error_weight 
)

This method sets a new weight for the solution error of a single dependent variable.

Parameters:
i Index of dependent variable.
new_solution_error_weight Weight for the error between the above dependent variable solution and the corresponding target solution.

Definition at line 332 of file solutions_error.cpp.

void OpenNN::SolutionsError::set_default ( void   )  [virtual]

This method sets the default values for an object of the solutions error class:

  • Solutions error method: Solutions error sum.
  • Solutions error weights: 1 for all dependent variables.
  • Display: True.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 347 of file solutions_error.cpp.

Matrix< double > OpenNN::SolutionsError::calculate_target_dependent_variables ( const Matrix< double > &  independent_variables  )  const [virtual]

This method returns the default target solution matrix.

Definition at line 373 of file solutions_error.cpp.

void OpenNN::SolutionsError::check ( void   )  const [virtual]

This method checks that:

  • The pointer to the neural network is not NULL.
  • The pointer to the multilayer perceptron inside the neural network is not NULL.
  • The pointer to the mathematical method is not NULL.
  • The size of the solutions errors weights is equal to the number of dependent variables.
If some of the conditions above is not hold, an exception is thrown.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 401 of file solutions_error.cpp.

double OpenNN::SolutionsError::calculate_solutions_error_sum ( void   )  const

This method calculates the solutions error evaluation as the weighted mean squared error between the solutions to the mathematical model and the target solutions.

Definition at line 481 of file solutions_error.cpp.

double OpenNN::SolutionsError::calculate_solutions_error_integral ( void   )  const

Todo:

Definition at line 529 of file solutions_error.cpp.

double OpenNN::SolutionsError::calculate_evaluation ( void   )  const [virtual]

This method returns the objective value of a neural network according to the solutions error on a mathematical model.

Implements OpenNN::PerformanceTerm.

Definition at line 539 of file solutions_error.cpp.

double OpenNN::SolutionsError::calculate_evaluation ( const Vector< double > &  parameters  )  const [virtual]

This method calculates the solutions error value of the neural network for a given set of parameters.

Parameters:
parameters Vector of potential neural network parameters.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 583 of file solutions_error.cpp.

std::string OpenNN::SolutionsError::write_performance_term_type ( void   )  const [virtual]

This method returns a string with the name of the solutions error performance type, "SOLUTIONS_ERROR".

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 610 of file solutions_error.cpp.

std::string OpenNN::SolutionsError::write_information ( void   )  const [virtual]

This method 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 618 of file solutions_error.cpp.

void OpenNN::SolutionsError::print ( void   )  const [virtual]

This method prints to the screen the string representation of this solutions error object.

Definition at line 632 of file solutions_error.cpp.

TiXmlElement * OpenNN::SolutionsError::to_XML ( void   )  const [virtual]

This method returns a representation of the solutions error object, in XML format.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 647 of file solutions_error.cpp.

void OpenNN::SolutionsError::from_XML ( TiXmlElement *  solutions_error_element  )  [virtual]

This method loads a solutions error object from a XML element.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 713 of file solutions_error.cpp.


Member Data Documentation

Numerical integration object.

Definition at line 134 of file solutions_error.h.

Method used to compute the error between the mathematical model solutions and the target solutions.

Definition at line 138 of file solutions_error.h.

Weights for the different dependent variables errors.

Definition at line 142 of file solutions_error.h.


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

Generated on Sun Aug 26 11:58:19 2012 for OpenNN by  doxygen 1.5.9