OpenNN  2.2
Open Neural Networks Library
outputs_integrals.h
1 /****************************************************************************************************************/
2 /* */
3 /* OpenNN: Open Neural Networks Library */
4 /* www.artelnics.com/opennn */
5 /* */
6 /* O U T P U T S I N T E G R A L S C L A S S H E A D E R */
7 /* */
8 /* Roberto Lopez */
9 /* Artelnics - Making intelligent use of data */
11 /* */
12 /****************************************************************************************************************/
13 
14 #ifndef __OUTPUTSINTEGRALS_H__
15 #define __OUTPUTSINTEGRALS_H__
16 
17 // System includes
18 
19 #include <iostream>
20 #include <fstream>
21 #include <cmath>
22 #include <sstream>
23 #include <string>
24 #include <limits>
25 
26 // OpenNN includes
27 
28 #include "performance_term.h"
29 #include "numerical_integration.h"
30 
31 // TinyXml includes
32 
33 #include "../tinyxml2/tinyxml2.h"
34 
35 namespace OpenNN
36 {
37 
42 
44 {
45 
46 public:
47 
48  // DEFAULT CONSTRUCTOR
49 
50  explicit OutputsIntegrals(void);
51 
52  // NEURAL NETWORK CONSTRUCTOR
53 
55 
56  // XML CONSTRUCTOR
57 
58  explicit OutputsIntegrals(const tinyxml2::XMLDocument&);
59 
60  // DESTRUCTOR
61 
62  virtual ~OutputsIntegrals(void);
63 
64  // METHODS
65 
66  // Get methods
67 
70 
72  const double& get_output_integral_weight(const size_t&) const;
73 
74  // Set methods
75 
77 
79  void set_output_integral_weight(const size_t&, const double&);
80 
81  void set_default(void);
82 
83  // Checking methods
84 
85  void check(void) const;
86 
87  // Regularization methods
88 
89  double calculate_performance(void) const;
90  double calculate_performance(const Vector<double>&) const;
91 
93 
95 
96  std::string write_performance_term_type(void) const;
97 
98  // Serialization methods
99 
100  tinyxml2::XMLDocument* to_XML(void) const;
101 
102  void from_XML(const tinyxml2::XMLDocument&);
103 
104 private:
105 
107 
109 
111 
113 
114 };
115 
116 }
117 
118 #endif
119 
120 
121 // OpenNN: Open Neural Networks Library.
122 // Copyright (c) 2005-2015 Roberto Lopez.
123 //
124 // This library is free software; you can redistribute it and/or
125 // modify it under the terms of the GNU Lesser General Public
126 // License as published by the Free Software Foundation; either
127 // version 2.1 of the License, or any later version.
128 //
129 // This library is distributed in the hope that it will be useful,
130 // but WITHOUT ANY WARRANTY; without even the implied warranty of
131 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
132 // Lesser General Public License for more details.
133 
134 // You should have received a copy of the GNU Lesser General Public
135 // License along with this library; if not, write to the Free Software
136 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
const Vector< double > & get_outputs_integrals_weights(void) const
Returns the weights for each integral of the neural network outputs.
NumericalIntegration numerical_integration
Object for numerical integration of functions.
NumericalIntegration * get_numerical_integration_pointer(void)
Returns a pointer to the numerical integration object inside the outputs integrals object...
Vector< double > outputs_integrals_weights
Weigth for each output integral.
Vector< double > calculate_gradient(void) const
const NumericalIntegration & get_numerical_integration(void) const
Returns a constant reference to the numerical integration object inside the outputs integrals object...
Matrix< double > calculate_Hessian(void) const
tinyxml2::XMLDocument * to_XML(void) const
Returns a representation of the sum squared error object, in XML format.
void set_outputs_integrals_weights(const Vector< double > &)
const double & get_output_integral_weight(const size_t &) const
double calculate_performance(void) const
void set_numerical_integration(const NumericalIntegration &)
std::string write_performance_term_type(void) const
Returns a string with the name of the outputs integrals performance type, "OUTPUTS_INTEGRALS".
virtual ~OutputsIntegrals(void)
Destructor.
void set_output_integral_weight(const size_t &, const double &)
void from_XML(const tinyxml2::XMLDocument &)