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

#include <outputs_integrals.h>

Inheritance diagram for OpenNN::OutputsIntegrals:
OpenNN::PerformanceTerm

Public Member Functions

 OutputsIntegrals (void)
 
 OutputsIntegrals (NeuralNetwork *)
 
 OutputsIntegrals (const tinyxml2::XMLDocument &)
 
virtual ~OutputsIntegrals (void)
 
const NumericalIntegrationget_numerical_integration (void) const
 
NumericalIntegrationget_numerical_integration_pointer (void)
 
const Vector< double > & get_outputs_integrals_weights (void) const
 
const double & get_output_integral_weight (const size_t &) const
 
void set_numerical_integration (const NumericalIntegration &)
 
void set_outputs_integrals_weights (const Vector< double > &)
 
void set_output_integral_weight (const size_t &, const double &)
 
void set_default (void)
 
void check (void) const
 
double calculate_performance (void) const
 
double calculate_performance (const Vector< double > &) const
 
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 *)
 
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_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
 

Private Attributes

NumericalIntegration numerical_integration
 
Vector< double > outputs_integrals_weights
 

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 outputs integrals performance term. It is defined as the weighted sum of the integrals of the neural network outputs. The neural network here must have only one input. This performance term might be used in optimal control as an objective or a regularization terms.

Definition at line 43 of file outputs_integrals.h.

Constructor & Destructor Documentation

OpenNN::OutputsIntegrals::OutputsIntegrals ( void  )
explicit

Default constructor. It creates an outputs integrals performance term 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 outputs_integrals.cpp.

OpenNN::OutputsIntegrals::OutputsIntegrals ( NeuralNetwork new_neural_network_pointer)
explicit

Neural network constructor. It creates an outputs integrals performance term 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 outputs_integrals.cpp.

OpenNN::OutputsIntegrals::OutputsIntegrals ( const tinyxml2::XMLDocument &  outputs_integrals_document)
explicit

XML constructor. It creates an outputs integrals performance term not associated to any neural network. The class members are loaded from a XML document.

Parameters
outputs_integrals_documentPointer to a TinyXML document with the object data.

Definition at line 55 of file outputs_integrals.cpp.

Member Function Documentation

Vector< double > OpenNN::OutputsIntegrals::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 multilayer perceptron parameters.

Todo:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 340 of file outputs_integrals.cpp.

Matrix< double > OpenNN::OutputsIntegrals::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:

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 362 of file outputs_integrals.cpp.

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

Returns the objective value of a multilayer perceptron according to the sum squared error on a data set.

Todo:

Implements OpenNN::PerformanceTerm.

Definition at line 239 of file outputs_integrals.cpp.

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

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

Implements OpenNN::PerformanceTerm.

Definition at line 284 of file outputs_integrals.cpp.

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

Checks that there are a neural network and a mathematical model associated to the outputs integrals performance term, and that there is a multilayer perceptron in the neural network. It also checks that the number of inputs in the neural network is 1. If some of the above conditions is not hold, the method throws an exception.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 185 of file outputs_integrals.cpp.

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

Loads an outputs integrals object from a XML document.

Parameters
documentTinyXML document containing the members of this object.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 445 of file outputs_integrals.cpp.

const double & OpenNN::OutputsIntegrals::get_output_integral_weight ( const size_t &  i) const

Returns the weight of a single integral of some neural network output.

Parameters
iIndex of neural network output.

Definition at line 108 of file outputs_integrals.cpp.

void OpenNN::OutputsIntegrals::set_default ( void  )
virtual

Sets the default values for the outputs integrals object:

  • Outputs integrals weights: 1 for each neural network output.
  • Display: true.

Reimplemented from OpenNN::PerformanceTerm.

Definition at line 156 of file outputs_integrals.cpp.

void OpenNN::OutputsIntegrals::set_numerical_integration ( const NumericalIntegration new_numerical_integration)

Sets a new numerical integration object inside the outputs integral object.

Parameters
new_numerical_integrationNumerical integration object.

Definition at line 119 of file outputs_integrals.cpp.

void OpenNN::OutputsIntegrals::set_output_integral_weight ( const size_t &  i,
const double &  new_output_integral_weight 
)

Sets a new weight for a single integral of the neural network outputs.

Parameters
iIndex of output.
new_output_integral_weightWeight value.

Definition at line 142 of file outputs_integrals.cpp.

void OpenNN::OutputsIntegrals::set_outputs_integrals_weights ( const Vector< double > &  new_outputs_integrals_weights)

Sets new weights for each integral of the neural network outputs.

Parameters
new_outputs_integrals_weightsWeight values.

Definition at line 130 of file outputs_integrals.cpp.


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