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

#include <mean_squared_error.h>

Inheritance diagram for OpenNN::MeanSquaredError:
OpenNN::PerformanceTerm

Public Member Functions

 MeanSquaredError (void)
 
 MeanSquaredError (NeuralNetwork *)
 
 MeanSquaredError (DataSet *)
 
 MeanSquaredError (NeuralNetwork *, DataSet *)
 
 MeanSquaredError (const tinyxml2::XMLDocument &)
 
 MeanSquaredError (const MeanSquaredError &)
 
virtual ~MeanSquaredError (void)
 
void check (void) const
 
double calculate_performance (void) const
 
double calculate_performance (const Vector< double > &) const
 
double calculate_generalization_performance (void) const
 
Vector< double > calculate_gradient (void) const
 
Matrix< double > calculate_Hessian (void) const
 
FirstOrderPerformance calculate_first_order_performance (void) const
 
SecondOrderPerformance calculate_second_order_performance (void) const
 
Vector< double > calculate_terms (void) const
 
Vector< double > calculate_terms (const Vector< double > &) const
 
Matrix< double > calculate_terms_Jacobian (void) const
 
FirstOrderTerms calculate_first_order_terms (void) const
 
std::string write_performance_term_type (void) const
 
tinyxml2::XMLDocument * to_XML (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 write_information (void) const
 
virtual std::string to_string (void) const
 
virtual void from_XML (const tinyxml2::XMLDocument &)
 
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 mean squared error performance term. The mean squared error measures the difference between the outputs from a neural network and the targets in a data set. This functional is used in data modeling problems, such as function regression, pattern recognition and time series prediction.

Definition at line 43 of file mean_squared_error.h.

Constructor & Destructor Documentation

OpenNN::MeanSquaredError::MeanSquaredError ( void  )
explicit

Default constructor. It creates a mean 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 27 of file mean_squared_error.cpp.

OpenNN::MeanSquaredError::MeanSquaredError ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates a mean squared error performance term object associated to a neural network object but not measured on any data set object. 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 mean_squared_error.cpp.

OpenNN::MeanSquaredError::MeanSquaredError ( DataSet new_data_set_pointer)
explicit

Data set constructor. It creates a mean squared error performance term not associated to any neural network but to be measured on a given 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 mean_squared_error.cpp.

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

Neural network and data set constructor. It creates a mean squared error performance term object 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 69 of file mean_squared_error.cpp.

OpenNN::MeanSquaredError::MeanSquaredError ( const tinyxml2::XMLDocument &  mean_squared_error_document)
explicit

XML constructor. It creates a mean squared error object with all pointers set to NULL. The object members are loaded by means of a XML document-> Please be careful with the format of that file, which is specified in the OpenNN manual.

Parameters
mean_squared_error_documentTinyXML document with the mean squared error elements.

Definition at line 83 of file mean_squared_error.cpp.

OpenNN::MeanSquaredError::MeanSquaredError ( const MeanSquaredError other_mean_squared_error)

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

Parameters
other_mean_squared_errorMean squared error object to be copied.

Definition at line 95 of file mean_squared_error.cpp.

Member Function Documentation

PerformanceTerm::FirstOrderPerformance OpenNN::MeanSquaredError::calculate_first_order_performance ( void  ) const
Todo:

Definition at line 595 of file mean_squared_error.cpp.

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

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

Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 911 of file mean_squared_error.cpp.

double OpenNN::MeanSquaredError::calculate_generalization_performance ( void  ) const
virtual

Returns the mean squared error of the multilayer perceptron measured on the generalization instances of the data set.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 389 of file mean_squared_error.cpp.

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

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

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 470 of file mean_squared_error.cpp.

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

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 583 of file mean_squared_error.cpp.

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

Returns which would be the performance term 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 289 of file mean_squared_error.cpp.

PerformanceTerm::SecondOrderPerformance OpenNN::MeanSquaredError::calculate_second_order_performance ( void  ) const
Todo:

Definition at line 618 of file mean_squared_error.cpp.

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

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

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 643 of file mean_squared_error.cpp.

Vector< double > OpenNN::MeanSquaredError::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 725 of file mean_squared_error.cpp.

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

Returns the Jacobian matrix of the mean squared error function, whose elements are given by the derivatives of the squared errors data set with respect to the multilayer perceptron parameters.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 771 of file mean_squared_error.cpp.

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

Checks that there are a neural network and a data set associated to the mean 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 mean_squared_error.cpp.

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

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

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 946 of file mean_squared_error.cpp.


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