OpenNN  2.2
Open Neural Networks Library
root_mean_squared_error.h
1 /****************************************************************************************************************/
2 /* */
3 /* OpenNN: Open Neural Networks Library */
4 /* www.artelnics.com/opennn */
5 /* */
6 /* R O O T M E A N S Q U A R E D E R R O R 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 __ROOTMEANSQUAREDERROR_H__
15 #define __ROOTMEANSQUAREDERROR_H__
16 
17 // System includes
18 
19 #include <iostream>
20 #include <cmath>
21 #include <fstream>
22 #include <limits>
23 #include <sstream>
24 #include <string>
25 
26 // OpenNN includes
27 
28 #include "performance_term.h"
29 #include "data_set.h"
30 
31 // TinyXml includes
32 
33 #include "../tinyxml2/tinyxml2.h"
34 
35 namespace OpenNN
36 {
37 
41 
43 {
44 
45 public:
46 
47  // DEFAULT CONSTRUCTOR
48 
49  explicit RootMeanSquaredError(void);
50 
51  // NEURAL NETWORK CONSTRUCTOR
52 
54 
55  // DATA SET CONSTRUCTOR
56 
57  explicit RootMeanSquaredError(DataSet*);
58 
59  // GENERAL CONSTRUCTOR
60 
62 
63  // XML CONSTRUCTOR
64 
65  explicit RootMeanSquaredError(const tinyxml2::XMLDocument&);
66 
67  // DESTRUCTOR
68 
69  virtual ~RootMeanSquaredError(void);
70 
71  // METHODS
72 
73  // Get methods
74 
75  // Set methods
76 
77  // Checking methods
78 
79  void check(void) const;
80 
81  // Performance term performance methods
82 
83  double calculate_performance(void) const;
84  double calculate_performance(const Vector<double>&) const;
85  double calculate_generalization_performance(void) const;
86 
88 
90 
91  std::string write_performance_term_type(void) const;
92 
93  // Serialization methods
94 
95  tinyxml2::XMLDocument* to_XML(void) const;
96  void from_XML(const tinyxml2::XMLDocument&);
97 
98 };
99 
100 }
101 
102 #endif
103 
104 
105 // OpenNN: Open Neural Networks Library.
106 // Copyright (c) 2005-2015 Roberto Lopez.
107 //
108 // This library is free software; you can redistribute it and/or
109 // modify it under the terms of the GNU Lesser General Public
110 // License as published by the Free Software Foundation; either
111 // version 2.1 of the License, or any later version.
112 //
113 // This library is distributed in the hope that it will be useful,
114 // but WITHOUT ANY WARRANTY; without even the implied warranty of
115 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
116 // Lesser General Public License for more details.
117 //
118 // You should have received a copy of the GNU Lesser General Public
119 // License along with this library; if not, write to the Free Software
120 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
double calculate_generalization_performance(void) const
Returns the root mean squared error of the multilayer perceptron measured on the generalization insta...
tinyxml2::XMLDocument * to_XML(void) const
virtual ~RootMeanSquaredError(void)
Destructor.
Vector< double > calculate_gradient(void) const
Calculates the gradient the root mean squared error funcion by means of the back-propagation algorith...
std::string write_performance_term_type(void) const
Returns a string with the name of the root mean squared error performance type, "ROOT_MEAN_SQUARED_ER...
Matrix< double > calculate_Hessian(void) const
void from_XML(const tinyxml2::XMLDocument &)