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

#include <sum_squared_error.h>

Inheritance diagram for OpenNN::SumSquaredError:
OpenNN::PerformanceTerm

Public Member Functions

 SumSquaredError (void)
 
 SumSquaredError (NeuralNetwork *)
 
 SumSquaredError (DataSet *)
 
 SumSquaredError (NeuralNetwork *, DataSet *)
 
 SumSquaredError (const tinyxml2::XMLDocument &)
 
 SumSquaredError (const SumSquaredError &)
 
virtual ~SumSquaredError (void)
 
void check (void) const
 
double calculate_performance (void) const
 
double calculate_generalization_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
 
Vector< double > calculate_terms (void) const
 
Vector< double > calculate_terms (const Vector< double > &) const
 
Matrix< double > calculate_terms_Jacobian (void) const
 
PerformanceTerm::FirstOrderTerms calculate_first_order_terms (void) const
 
Vector< double > calculate_squared_errors (void) const
 
std::string write_performance_term_type (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 *)
 
virtual void set_default (void)
 
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 std::string write_information (void) const
 
virtual std::string to_string (void) const
 
size_t calculate_Kronecker_delta (const size_t &, const size_t &) const
 

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 sum squared peformance term functional. This is used as the performance term in data modeling problems, such as function regression, pattern recognition or time series prediction.

Definition at line 42 of file sum_squared_error.h.

Constructor & Destructor Documentation

OpenNN::SumSquaredError::SumSquaredError ( void  )
explicit

Default constructor. It creates a sum squared error performance term not associated to any neural network and not measured on any data set. It also initializes all the rest of class members to their default values.

Definition at line 28 of file sum_squared_error.cpp.

OpenNN::SumSquaredError::SumSquaredError ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates a sum squared error performance term associated to a neural network but not measured on any data set. 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 40 of file sum_squared_error.cpp.

OpenNN::SumSquaredError::SumSquaredError ( DataSet new_data_set_pointer)
explicit

Data set constructor. It creates a sum squared error not associated to any neural network but to be measured on a data set object. It also initializes all the rest of class members to their default values.

Parameters
new_data_set_pointerPointer to a data set object.

Definition at line 53 of file sum_squared_error.cpp.

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

Neural network and data set constructor. It creates a sum squared error associated to a neural network and measured on a data set. 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 67 of file sum_squared_error.cpp.

OpenNN::SumSquaredError::SumSquaredError ( const tinyxml2::XMLDocument &  sum_squared_error_document)
explicit

XML constructor. It creates a sum squared error not associated to any neural network and not measured on any data set. It also sets all the rest of class members from a TinyXML document.

Parameters
sum_squared_error_documentXML document with the class members.

Definition at line 80 of file sum_squared_error.cpp.

OpenNN::SumSquaredError::SumSquaredError ( const SumSquaredError new_sum_squared_error)

Copy constructor. It creates a sum squared error not associated to any neural network and not measured on any data set. It also sets all the rest of class members from another sum squared error object.

Parameters
new_sum_squared_errorObject to be copied.

Definition at line 94 of file sum_squared_error.cpp.

Member Function Documentation

PerformanceTerm::FirstOrderTerms OpenNN::SumSquaredError::calculate_first_order_terms ( void  ) const
virtual

Returns the first order performance of the terms performance function. This is a structure containing the performance terms vector and the performance terms Jacobian.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 964 of file sum_squared_error.cpp.

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

Calculates the performance term gradient by means of the back-propagation algorithm, and returns it in a single vector of size the number of neural network parameters.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 447 of file sum_squared_error.cpp.

Vector< double > OpenNN::SumSquaredError::calculate_gradient ( const Vector< double > &  ) const
virtual
Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 1059 of file sum_squared_error.cpp.

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

Calculates the Hessian by means of the back-propagation algorithm, and returns it in a single symmetric matrix of size the number of neural network parameters.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 568 of file sum_squared_error.cpp.

Matrix< double > OpenNN::SumSquaredError::calculate_Hessian ( const Vector< double > &  ) const
virtual
Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 1071 of file sum_squared_error.cpp.

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

Returns which would be the sum squard error performance 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 the performance term.

Implements OpenNN::PerformanceTerm.

Definition at line 268 of file sum_squared_error.cpp.

Vector< double > OpenNN::SumSquaredError::calculate_terms ( const Vector< double > &  parameters) const
virtual

Returns the performance terms vector for a hypotetical vector of parameters.

Parameters
parametersNeural network parameters for which the performance terms vector is to be computed.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 773 of file sum_squared_error.cpp.

Matrix< double > OpenNN::SumSquaredError::calculate_terms_Jacobian ( void  ) const
virtual

Returns the terms_Jacobian matrix of the sum squared error function, whose elements are given by the derivatives of the squared errors data set with respect to the multilayer perceptron parameters. The terms_Jacobian matrix here is computed using a back-propagation algorithm.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 821 of file sum_squared_error.cpp.

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

Checks that there are a neural network and a data set associated to the sum squared error, and that the numbers of inputs and outputs in the neural network are equal to the numbers of inputs and targets in the data set. If some of the above conditions is not hold, the method throws an exception.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 118 of file sum_squared_error.cpp.

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

Loads a sum squared error object from a XML document.

Parameters
documentTinyXML document containing the members of the object.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 1127 of file sum_squared_error.cpp.


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