OpenNN  2.2
Open Neural Networks Library
mean_squared_error.h
1 /****************************************************************************************************************/
2 /* */
3 /* OpenNN: Open Neural Networks Library */
4 /* www.artelnics.com/opennn */
5 /* */
6 /* 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 __MEANSQUAREDERROR_H__
15 #define __MEANSQUAREDERROR_H__
16 
17 // System includes
18 
19 #include <string>
20 #include <sstream>
21 #include <iostream>
22 #include <fstream>
23 #include <limits>
24 #include <math.h>
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 
42 
44 {
45 
46 public:
47 
48  // DEFAULT CONSTRUCTOR
49 
50  explicit MeanSquaredError(void);
51 
52  // NEURAL NETWORK CONSTRUCTOR
53 
55 
56  // DATA SET CONSTRUCTOR
57 
58  explicit MeanSquaredError(DataSet*);
59 
60  // GENERAL CONSTRUCTOR
61 
63 
64  // XML CONSTRUCTOR
65 
66  explicit MeanSquaredError(const tinyxml2::XMLDocument&);
67 
68  // COPY CONSTRUCTOR
69 
71 
72  // DESTRUCTOR
73 
74  virtual ~MeanSquaredError(void);
75 
76  // STRUCTURES
77 
78 
79  // METHODS
80 
81  // Get methods
82 
83  // Set methods
84 
85  // Checking methods
86 
87  void check(void) const;
88 
89  // Objective methods
90 
91  double calculate_performance(void) const;
92  double calculate_performance(const Vector<double>&) const;
93  double calculate_generalization_performance(void) const;
94 
96 
98 
101 
102  // Objective terms methods
103 
104  Vector<double> calculate_terms(void) const;
106 
108 
110 
111  std::string write_performance_term_type(void) const;
112 
113  // Serialization methods
114 
115  tinyxml2::XMLDocument* to_XML(void) const;
116 
117 
118 private:
119 
120 
121 };
122 
123 }
124 
125 #endif
126 
127 
128 // OpenNN: Open Neural Networks Library.
129 // Copyright (c) 2005-2015 Roberto Lopez.
130 //
131 // This library is free software; you can redistribute it and/or
132 // modify it under the terms of the GNU Lesser General Public
133 // License as published by the Free Software Foundation; either
134 // version 2.1 of the License, or any later version.
135 //
136 // This library is distributed in the hope that it will be useful,
137 // but WITHOUT ANY WARRANTY; without even the implied warranty of
138 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
139 // Lesser General Public License for more details.
140 
141 // You should have received a copy of the GNU Lesser General Public
142 // License along with this library; if not, write to the Free Software
143 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
virtual ~MeanSquaredError(void)
Destructor.
Vector< double > calculate_terms(void) const
Vector< double > calculate_gradient(void) const
tinyxml2::XMLDocument * to_XML(void) const
FirstOrderTerms calculate_first_order_terms(void) const
Returns a first order terms performance structure, which contains the values and the Jacobian of the ...
Matrix< double > calculate_Hessian(void) const
double calculate_generalization_performance(void) const
std::string write_performance_term_type(void) const
Returns a string with the name of the mean squared error performance type, "MEAN_SQUARED_ERROR".
double calculate_performance(void) const
Returns the mean squared error of a neural network on a data set.
FirstOrderPerformance calculate_first_order_performance(void) const
SecondOrderPerformance calculate_second_order_performance(void) const
Matrix< double > calculate_terms_Jacobian(void) const