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

#include <normalized_squared_error.h>

Inheritance diagram for OpenNN::NormalizedSquaredError:
OpenNN::PerformanceTerm

Public Member Functions

 NormalizedSquaredError (NeuralNetwork *, DataSet *)
 
 NormalizedSquaredError (NeuralNetwork *)
 
 NormalizedSquaredError (DataSet *)
 
 NormalizedSquaredError (void)
 
 NormalizedSquaredError (const tinyxml2::XMLDocument &)
 
virtual ~NormalizedSquaredError (void)
 
double calculate_normalization_coefficient (const Matrix< double > &, const Vector< double > &) const
 
void check (void) 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
 
double calculate_generalization_performance (void) 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
 
Vector< size_t > calculate_maximal_errors (const size_t &=10) const
 
std::string write_performance_term_type (void) const
 
tinyxml2::XMLDocument * to_XML (void) const
 
void from_XML (const tinyxml2::XMLDocument &)
 
std::string write_information (void) const
 
- 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 Vector< double > calculate_gradient (const Vector< double > &) const
 
virtual Matrix< double > calculate_Hessian (const Vector< double > &) const
 
virtual std::string to_string (void) const
 
size_t calculate_Kronecker_delta (const size_t &, const size_t &) const
 

Private Attributes

Vector< double > training_target_mean
 

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 normalized squared error performance term. This performance term is used in data modeling problems. If it has a value of unity then the neural network is predicting the data "in the mean", A value of zero means perfect prediction of data.

Definition at line 44 of file normalized_squared_error.h.

Constructor & Destructor Documentation

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

Neural network and data set constructor. It creates a normalized squared error performance term 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 68 of file normalized_squared_error.cpp.

OpenNN::NormalizedSquaredError::NormalizedSquaredError ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates a normalized squared error performance term associated to a neural network object 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 normalized_squared_error.cpp.

OpenNN::NormalizedSquaredError::NormalizedSquaredError ( DataSet new_data_set_pointer)
explicit

Data set constructor. It creates a normalized squared error performance term 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 54 of file normalized_squared_error.cpp.

OpenNN::NormalizedSquaredError::NormalizedSquaredError ( void  )
explicit

Default constructor. It creates a normalized squared error performance term object 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 normalized_squared_error.cpp.

OpenNN::NormalizedSquaredError::NormalizedSquaredError ( const tinyxml2::XMLDocument &  normalized_squared_error_document)
explicit

XML constructor. It creates a normalized 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
normalized_squared_error_documentXML document with the class members.

Definition at line 81 of file normalized_squared_error.cpp.

Member Function Documentation

NormalizedSquaredError::FirstOrderTerms OpenNN::NormalizedSquaredError::calculate_first_order_terms ( void  ) const
virtual

Returns a first order performance terms performance structure, which contains the values and the Jacobian of the performance terms function.

Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 1009 of file normalized_squared_error.cpp.

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

Returns the normalized squared error function gradient of a multilayer perceptron on a data set. It uses the error back-propagation method.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 523 of file normalized_squared_error.cpp.

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

Returns the normalized squared error function Hessian of a multilayer perceptron on a data set. It uses the error back-propagation method.

Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 673 of file normalized_squared_error.cpp.

Vector< size_t > OpenNN::NormalizedSquaredError::calculate_maximal_errors ( const size_t &  maximal_errors_number = 10) const

Returns a vector with the indices of the instances which have the maximum error.

Parameters
maximal_errors_numberNumber of instances required.

Definition at line 1108 of file normalized_squared_error.cpp.

double OpenNN::NormalizedSquaredError::calculate_normalization_coefficient ( const Matrix< double > &  target_data,
const Vector< double > &  target_data_mean 
) const

Returns the normalization coefficient to be used for the performance of the error. This is measured on the training instances of the data set.

Definition at line 103 of file normalized_squared_error.cpp.

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

Returns which would be the performance of a multilayer perceptron for an hypothetical vector of parameters. It does not set that vector of parameters to the multilayer perceptron.

Parameters
parametersVector of potential parameters for the multilayer perceptron associated to the performance functional.

Implements OpenNN::PerformanceTerm.

Definition at line 306 of file normalized_squared_error.cpp.

Vector< double > OpenNN::NormalizedSquaredError::calculate_terms ( void  ) const
virtual

Returns performance vector of the performance terms function for the normalized squared error. It uses the error back-propagation method.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 686 of file normalized_squared_error.cpp.

Vector< double > OpenNN::NormalizedSquaredError::calculate_terms ( const Vector< double > &  network_parameters) const
virtual

Returns which would be the performance terms performance vector of a multilayer perceptron for an hypothetical vector of multilayer perceptron parameters. It does not set that vector of parameters to the multilayer perceptron.

Parameters
network_parametersVector of a potential multilayer_perceptron_pointer parameters for the multilayer perceptron associated to the performance functional.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 787 of file normalized_squared_error.cpp.

Matrix< double > OpenNN::NormalizedSquaredError::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 837 of file normalized_squared_error.cpp.

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

Checks that there are a neural network and a data set associated to the normalized 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 115 of file normalized_squared_error.cpp.

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

Loads a root mean squared error object from a XML document.

Parameters
documentPointer to a TinyXML document with the object data.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 1185 of file normalized_squared_error.cpp.

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

Serializes the normalized squared error object into a XML document of the TinyXML library. See the OpenNN manual for more information about the format of this element.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 1152 of file normalized_squared_error.cpp.

std::string OpenNN::NormalizedSquaredError::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 1214 of file normalized_squared_error.cpp.


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