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

#include <independent_parameters_error.h>

Inheritance diagram for OpenNN::IndependentParametersError:
OpenNN::PerformanceTerm

Public Member Functions

 IndependentParametersError (void)
 
 IndependentParametersError (NeuralNetwork *)
 
 IndependentParametersError (const tinyxml2::XMLDocument &)
 
virtual ~IndependentParametersError (void)
 
IndependentParametersErroroperator= (const IndependentParametersError &)
 
bool operator== (const IndependentParametersError &) const
 
const Vector< double > & get_target_independent_parameters (void) const
 
const double & get_target_independent_parameter (const size_t &) const
 
const Vector< double > & get_independent_parameters_errors_weights (void) const
 
const double & get_independent_parameter_error_weight (const size_t &) const
 
void set_target_independent_parameters (const Vector< double > &)
 
void set_target_independent_parameter (const size_t &, const double &)
 
void set_independent_parameters_errors_weights (const Vector< double > &)
 
void set_independent_parameter_error_weight (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
 
Vector< double > calculate_gradient (void) const
 
Matrix< double > calculate_Hessian (void) 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 (void)
 
virtual void set (NeuralNetwork *)
 
virtual void set (DataSet *)
 
virtual void set (MathematicalModel *)
 
virtual void set (NeuralNetwork *, DataSet *)
 
virtual void set (NeuralNetwork *, MathematicalModel *)
 
virtual void set (NeuralNetwork *, MathematicalModel *, DataSet *)
 
void set (const PerformanceTerm &)
 
virtual void set_neural_network_pointer (NeuralNetwork *)
 
virtual void set_mathematical_model_pointer (MathematicalModel *)
 
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 (const Vector< double > &) 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_independent_parameters
 
Vector< double > independent_parameters_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 performance term measures the error between a set of independent parameteres and a set of targer parameters. This performance term can be used in optimal control problems. A typical example are those problems with free final time.

Definition at line 43 of file independent_parameters_error.h.

Constructor & Destructor Documentation

OpenNN::IndependentParametersError::IndependentParametersError ( void  )
explicit

Default constructor. It creates a independent parameters error performance term with all pointers initialized to NULL. It also initializes all the rest of class members to their default values.

Definition at line 28 of file independent_parameters_error.cpp.

OpenNN::IndependentParametersError::IndependentParametersError ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates a independent parameters error performance term associated to a neural network. 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 44 of file independent_parameters_error.cpp.

OpenNN::IndependentParametersError::IndependentParametersError ( const tinyxml2::XMLDocument &  independent_parameters_error_document)
explicit

XML constructor. It creates a independent parameters error performance term with all pointers initialized to NULL. It also loads the rest of class members from a XML document.

Parameters
independent_parameters_error_documentTinyXML document of a independent parameters values object.

Definition at line 60 of file independent_parameters_error.cpp.

Member Function Documentation

Vector< double > OpenNN::IndependentParametersError::calculate_gradient ( void  ) const
virtual

Returns the performance term gradient.

Returns the default gradient vector of the performance term. It uses numerical differentiation.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 406 of file independent_parameters_error.cpp.

Matrix< double > OpenNN::IndependentParametersError::calculate_Hessian ( void  ) const
virtual

Returns the performance term Hessian.

Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 436 of file independent_parameters_error.cpp.

double OpenNN::IndependentParametersError::calculate_performance ( const Vector< double > &  parameters) const
virtual
Todo:

Implements OpenNN::PerformanceTerm.

Definition at line 362 of file independent_parameters_error.cpp.

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

Checks that there are a neural network and a data set associated to the sum squared error, and that the number of independent parameters in the neural network is equal to the number of size of the target independent parameters 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 257 of file independent_parameters_error.cpp.

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

Loads a default performance term from a XML document.

Parameters
documentTinyXML document containing the performance term members.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 563 of file independent_parameters_error.cpp.

const double & OpenNN::IndependentParametersError::get_independent_parameter_error_weight ( const size_t &  i) const

Returns the weight for a singel error between an independent parameters and its target value.

Parameters
iIndex of independent parameter parameter.

Definition at line 165 of file independent_parameters_error.cpp.

const double & OpenNN::IndependentParametersError::get_target_independent_parameter ( const size_t &  i) const

Returns the desired value of a single independent parameter.

Parameters
iIndex of independent parameter.

Definition at line 144 of file independent_parameters_error.cpp.

void OpenNN::IndependentParametersError::set_default ( void  )
virtual

Sets the default values for this object:

  • Target independent parameters: 0 for all parameters.
  • Errors weights: 1 for all errors.
  • Display: True.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 226 of file independent_parameters_error.cpp.

void OpenNN::IndependentParametersError::set_independent_parameter_error_weight ( const size_t &  i,
const double &  new_independent_parameter_error_weight 
)

Sets a new weight for the error between a single independent parameter and its target value.

Parameters
iIndex of independent parameter.
new_independent_parameter_error_weightWeight value.

Definition at line 211 of file independent_parameters_error.cpp.

void OpenNN::IndependentParametersError::set_independent_parameters_errors_weights ( const Vector< double > &  new_independent_parameters_errors_weights)

Sets new weights for each error between the actual independent parameters and their target values.

Parameters
new_independent_parameters_errors_weightsVector of weights, with size the number of independent parameters.

Definition at line 199 of file independent_parameters_error.cpp.

void OpenNN::IndependentParametersError::set_target_independent_parameter ( const size_t &  i,
const double &  new_target_independent_parameter 
)

Sets the desired value of a single independent parameter.

Parameters
iIndex of independent parameter.
new_target_independent_parameterDesired value for that parameter.

Definition at line 188 of file independent_parameters_error.cpp.

void OpenNN::IndependentParametersError::set_target_independent_parameters ( const Vector< double > &  new_target_independent_parameters)

Sets new desired values for the independent parameters.

Parameters
new_target_independent_parametersVector of desired values for the independent parameters.

Definition at line 176 of file independent_parameters_error.cpp.

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

Returns a representation of the independent parameters error object, in XML format.

Todo:
Add numerical differentiation tag.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 495 of file independent_parameters_error.cpp.

std::string OpenNN::IndependentParametersError::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 480 of file independent_parameters_error.cpp.


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