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

#include <neural_parameters_norm.h>

Inheritance diagram for OpenNN::NeuralParametersNorm:
OpenNN::PerformanceTerm

Public Member Functions

 NeuralParametersNorm (void)
 
 NeuralParametersNorm (NeuralNetwork *)
 
 NeuralParametersNorm (const tinyxml2::XMLDocument &)
 
virtual ~NeuralParametersNorm (void)
 
const double & get_neural_parameters_norm_weight (void) const
 
void set_neural_parameters_norm_weight (const double &)
 
void set_default (void)
 
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
 
Vector< double > calculate_gradient (const Vector< double > &) const
 
Matrix< double > calculate_Hessian (const Vector< double > &) 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_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

double neural_parameters_norm_weight
 

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 neural parameters norm performance term. This performance term is very useful as a regularization functional in data modeling, optimal control or inverse problems.

Definition at line 40 of file neural_parameters_norm.h.

Constructor & Destructor Documentation

OpenNN::NeuralParametersNorm::NeuralParametersNorm ( void  )
explicit

Default constructor. It creates a neural parameters norm functional not associated to any neural network. It also initializes all the rest of class members to their default values.

Definition at line 27 of file neural_parameters_norm.cpp.

OpenNN::NeuralParametersNorm::NeuralParametersNorm ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates a neural parameters norm functional 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 41 of file neural_parameters_norm.cpp.

OpenNN::NeuralParametersNorm::NeuralParametersNorm ( const tinyxml2::XMLDocument &  neural_parameters_norm_document)
explicit

XML constructor. It creates a neural parameters norm object not associated to any neural network. 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
neural_parameters_norm_documentTinyXML document with the neural parameters norm elements.

Definition at line 56 of file neural_parameters_norm.cpp.

OpenNN::NeuralParametersNorm::~NeuralParametersNorm ( void  )
virtual

Destructor. This destructor does not delete any pointer.

Definition at line 70 of file neural_parameters_norm.cpp.

Member Function Documentation

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

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

Todo:
Case including independent parameters.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 199 of file neural_parameters_norm.cpp.

Vector< double > OpenNN::NeuralParametersNorm::calculate_gradient ( const Vector< double > &  parameters) const
virtual

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

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 283 of file neural_parameters_norm.cpp.

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

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

Todo:

Second derivatives.

Case including independent parameters.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 225 of file neural_parameters_norm.cpp.

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

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 313 of file neural_parameters_norm.cpp.

double OpenNN::NeuralParametersNorm::calculate_performance ( void  ) const
virtual

Returns the performance of this peformance term. It is equal to the weighted norm of the parameters from the associated neural network.

Implements OpenNN::PerformanceTerm.

Definition at line 174 of file neural_parameters_norm.cpp.

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

Returns the neural parameters norm value of a neural network for a vector of parameters. It does not set that vector of parameters to the neural network.

Parameters
parametersVector of parameters for the neural network associated to the performance term.

Implements OpenNN::PerformanceTerm.

Definition at line 249 of file neural_parameters_norm.cpp.

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

Checks that there is a neural network associated to this performance term, and that there is a multilayer perceptron in the neural network. If some of the above conditions is not hold, the method throws an exception.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 119 of file neural_parameters_norm.cpp.

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

Loads a sum squared error object from a XML document.

Parameters
documentTinyXML document containing the object members.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 435 of file neural_parameters_norm.cpp.

void OpenNN::NeuralParametersNorm::set_default ( void  )
virtual

Sets the default values for the neural parameters norm object:

  • Neural parameters norm weight: 0.1.
  • Display: true.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 105 of file neural_parameters_norm.cpp.

std::string OpenNN::NeuralParametersNorm::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 375 of file neural_parameters_norm.cpp.

std::string OpenNN::NeuralParametersNorm::write_performance_term_type ( void  ) const
virtual

Returns a string with the name of the neural parameters norm performance type, "NEURAL_PARAMETERS_NORM".

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 367 of file neural_parameters_norm.cpp.


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