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

#include <cross_entropy_error.h>

Inheritance diagram for OpenNN::CrossEntropyError:
OpenNN::PerformanceTerm

Public Member Functions

 CrossEntropyError (void)
 
 CrossEntropyError (NeuralNetwork *)
 
 CrossEntropyError (DataSet *)
 
 CrossEntropyError (NeuralNetwork *, DataSet *)
 
 CrossEntropyError (const tinyxml2::XMLDocument &)
 
 CrossEntropyError (const CrossEntropyError &)
 
virtual ~CrossEntropyError (void)
 
CrossEntropyErroroperator= (const CrossEntropyError &)
 
bool operator== (const CrossEntropyError &) const
 
void check (void) const
 
double calculate_performance (void) const
 
double calculate_performance (const Vector< double > &) const
 
double calculate_minimum_performance (void)
 
double calculate_generalization_performance (void) const
 
double calculate_minimum_generalization_performance (void)
 
Vector< double > calculate_gradient (void) const
 
Matrix< double > calculate_Hessian (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 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 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 cross entropy performance term. This functional is used in pattern recognition problems.

Definition at line 39 of file cross_entropy_error.h.

Constructor & Destructor Documentation

OpenNN::CrossEntropyError::CrossEntropyError ( void  )
explicit

Default constructor. It creates a default cross entropy error performance term object, which is 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 cross_entropy_error.cpp.

OpenNN::CrossEntropyError::CrossEntropyError ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates a cross entropy 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 cross_entropy_error.cpp.

OpenNN::CrossEntropyError::CrossEntropyError ( DataSet new_data_set_pointer)
explicit

Data set constructor. It creates a cross entropy 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 cross_entropy_error.cpp.

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

Neural network and data set constructor. It creates a cross entropy 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 67 of file cross_entropy_error.cpp.

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

XML constructor. It creates a cross entropy 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 cross_entropy_error.cpp.

OpenNN::CrossEntropyError::CrossEntropyError ( const CrossEntropyError new_cross_entropy_error)

Copy constructor. It creates a cross entropy 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_cross_entropy_errorObject to be copied.

Definition at line 93 of file cross_entropy_error.cpp.

Member Function Documentation

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

Returns the cross entropy error of the neural network measured on the generalization instances of the data set.

Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 370 of file cross_entropy_error.cpp.

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

Returns the cross entropy error gradient of a neural network on a data set. It uses the error back-propagation method.

Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 466 of file cross_entropy_error.cpp.

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

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 620 of file cross_entropy_error.cpp.

double OpenNN::CrossEntropyError::calculate_minimum_generalization_performance ( void  )

Returns the minimum achieveable cross entropy for the generalization data.

Todo:

Definition at line 454 of file cross_entropy_error.cpp.

double OpenNN::CrossEntropyError::calculate_minimum_performance ( void  )

Returns the minimum achieveable cross entropy for the training data.

Todo:

Definition at line 359 of file cross_entropy_error.cpp.

double OpenNN::CrossEntropyError::calculate_performance ( void  ) const
virtual
Todo:

Implements OpenNN::PerformanceTerm.

Definition at line 268 of file cross_entropy_error.cpp.

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

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

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 157 of file cross_entropy_error.cpp.

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

Deserializes a TinyXML document into this cross entropy object.

Parameters
documentTinyXML document containing the member data.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 677 of file cross_entropy_error.cpp.

CrossEntropyError & OpenNN::CrossEntropyError::operator= ( const CrossEntropyError other_cross_entropy_error)

Assignment operator.

Parameters
other_cross_entropy_errorObject to be copied.

Definition at line 114 of file cross_entropy_error.cpp.

bool OpenNN::CrossEntropyError::operator== ( const CrossEntropyError other_cross_entropy_error) const

Equal to operator. If compares this object with another object of the same class, and returns true if they are equal, and false otherwise.

Parameters
other_cross_entropy_errorObject to be compared with.

Definition at line 133 of file cross_entropy_error.cpp.

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

Serializes the cross entropy 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 643 of file cross_entropy_error.cpp.


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