OpenNN  2.2
Open Neural Networks Library
minkowski_error.h
1 /****************************************************************************************************************/
2 /* */
3 /* OpenNN: Open Neural Networks Library */
4 /* www.artelnics.com/opennn */
5 /* */
6 /* M I N K O W S K I 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 __MINKOWSKIERROR_H__
15 #define __MINKOWSKIERROR_H__
16 
17 // System includes
18 
19 #include <string>
20 #include <sstream>
21 #include <iostream>
22 #include <fstream>
23 #include <cmath>
24 
25 // OpenNN includes
26 
27 #include "performance_term.h"
28 #include "data_set.h"
29 
30 // TinyXml includes
31 
32 #include "../tinyxml2/tinyxml2.h"
33 
34 namespace OpenNN
35 {
36 
41 
43 {
44 
45 public:
46 
47  // DEFAULT CONSTRUCTOR
48 
49  explicit MinkowskiError(void);
50 
51  // NEURAL NETWORK CONSTRUCTOR
52 
53  explicit MinkowskiError(NeuralNetwork*);
54 
55  // DATA SET CONSTRUCTOR
56 
57  explicit MinkowskiError(DataSet*);
58 
59  // NEURAL NETWORK AND DATA SET CONSTRUCTOR
60 
62 
63  // XML CONSTRUCTOR
64 
65  explicit MinkowskiError(const tinyxml2::XMLDocument&);
66 
67  // DESTRUCTOR
68 
69  virtual ~MinkowskiError(void);
70 
71 
72  // METHODS
73 
74  // Get methods
75 
76  double get_Minkowski_parameter(void) const;
77 
78  // Set methods
79 
80  void set_default(void);
81 
82  void set_Minkowski_parameter(const double&);
83 
84  // Checking methods
85 
86  void check(void) const;
87 
88  // performance methods
89 
90  double calculate_performance(void) const;
91  double calculate_performance(const Vector<double>&) const;
92  double calculate_generalization_performance(void) const;
93 
96 
97  std::string write_performance_term_type(void) const;
98 
99  // Serialization methods
100 
101  tinyxml2::XMLDocument* to_XML(void) const;
102  void from_XML(const tinyxml2::XMLDocument&);
103 
104 private:
105 
106  // MEMBERS
107 
109 
111 
112 };
113 
114 }
115 
116 #endif
117 
118 
119 // OpenNN: Open Neural Networks Library.
120 // Copyright (c) 2005-2015 Roberto Lopez.
121 //
122 // This library is free software; you can redistribute it and/or
123 // modify it under the terms of the GNU Lesser General Public
124 // License as published by the Free Software Foundation; either
125 // version 2.1 of the License, or any later version.
126 //
127 // This library is distributed in the hope that it will be useful,
128 // but WITHOUT ANY WARRANTY; without even the implied warranty of
129 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
130 // Lesser General Public License for more details.
131 
132 // You should have received a copy of the GNU Lesser General Public
133 // License along with this library; if not, write to the Free Software
134 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
double Minkowski_parameter
Minkowski exponent value.
double calculate_performance(void) const
Returns the Minkowski error performance.
void set_Minkowski_parameter(const double &)
Vector< double > calculate_gradient(void) const
virtual ~MinkowskiError(void)
void from_XML(const tinyxml2::XMLDocument &)
Matrix< double > calculate_Hessian(void) const
double calculate_generalization_performance(void) const
tinyxml2::XMLDocument * to_XML(void) const
double get_Minkowski_parameter(void) const
Returns the Minkowski exponent value used to calculate the error.
void check(void) const
std::string write_performance_term_type(void) const
Returns a string with the name of the Minkowski error performance type, "MINKOWSKI_ERROR".