OpenNN  2.2
Open Neural Networks Library
final_solutions_error.h
1 /****************************************************************************************************************/
2 /* */
3 /* OpenNN: Open Neural Networks Library */
4 /* www.artelnics.com/opennn */
5 /* */
6 /* F I N A L S O L U T I O N S 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 __FINALSOLUTIONSERROR_H__
15 #define __FINALSOLUTIONSERROR_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 "mathematical_model.h"
29 
30 #include "performance_term.h"
31 
32 // TinyXml includes
33 
34 #include "../tinyxml2/tinyxml2.h"
35 
36 namespace OpenNN
37 {
38 
42 
44 {
45 
46 public:
47 
48  // DEFAULT CONSTRUCTOR
49 
50  explicit FinalSolutionsError(void);
51 
52  // NEURAL NETWORK CONSTRUCTOR
53 
55 
56  // MATHEMATICAL MODEL CONSTRUCTOR
57 
59 
60  // NEURAL NETWORK AND MATHEMATICAL MODEL CONSTRUCTOR
61 
63 
64  // XML CONSTRUCTOR
65 
66  explicit FinalSolutionsError(const tinyxml2::XMLDocument&);
67 
68  // COPY CONSTRUCTOR
69 
71 
72  // DESTRUCTOR
73 
74  virtual ~FinalSolutionsError(void);
75 
76  // ASSIGNMENT OPERATOR
77 
79 
80  // EQUAL TO OPERATOR
81 
82  bool operator == (const FinalSolutionsError&) const;
83 
84  // METHODS
85 
86  // Get methods
87 
89 
90  const Vector<double>& get_target_final_solutions(void) const;
91 
92  // Set methods
93 
94  void set(void);
95 
96  void set(NeuralNetwork*);
97  void set(MathematicalModel*);
99 
100 // void set(const FinalSolutionsError&);
101 
103 
105  void set_final_solution_error_weight(const size_t&, const double&);
106 
108  void set_target_final_solution(const size_t&, const double&);
109 
110  void set_default(void);
111 
112  // Checking methods
113 
114  void check(void) const;
115 
116  // Performance term methods
117 
118  double calculate_performance(void) const;
119  double calculate_performance(const Vector<double>&) const;
120 
121  std::string write_performance_term_type(void) const;
122 
123  std::string write_information(void) const;
124 
125  // Serialization methods
126 
127  tinyxml2::XMLDocument* to_XML(void) const;
128  void from_XML(const tinyxml2::XMLDocument&);
129 
130 private:
131 
132  // MEMBERS
133 
136 
138 
141 
143 
144 };
145 
146 }
147 
148 #endif
149 
150 
151 // OpenNN: Open Neural Networks Library.
152 // Copyright (c) 2005-2015 Roberto Lopez.
153 //
154 // This library is free software; you can redistribute it and/or
155 // modify it under the terms of the GNU Lesser General Public
156 // License as published by the Free Software Foundation; either
157 // version 2.1 of the License, or any later version.
158 //
159 // This library is distributed in the hope that it will be useful,
160 // but WITHOUT ANY WARRANTY; without even the implied warranty of
161 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
162 // Lesser General Public License for more details.
163 
164 // You should have received a copy of the GNU Lesser General Public
165 // License along with this library; if not, write to the Free Software
166 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
void set_final_solution_error_weight(const size_t &, const double &)
const Vector< double > & get_target_final_solutions(void) const
Returns the desired final state of each dependent variable.
virtual ~FinalSolutionsError(void)
Destructor.
double calculate_performance(void) const
Returns the performance value of the performance term.
Vector< double > final_solutions_errors_weights
std::string write_performance_term_type(void) const
Returns a string with the name of the final solutions error performance type, "FINAL_SOLUTIONS_ERROR"...
const Vector< double > & get_final_solutions_errors_weights(void) const
Returns the weight values for each error in the final solutions.
void set_mathematical_model_pointer(MathematicalModel *)
void set_target_final_solutions(const Vector< double > &)
FinalSolutionsError & operator=(const FinalSolutionsError &)
Assignment operator.
void set_target_final_solution(const size_t &, const double &)
void from_XML(const tinyxml2::XMLDocument &)
bool operator==(const FinalSolutionsError &) const
tinyxml2::XMLDocument * to_XML(void) const
Returns a representation of the sum squared error object, in XML format.
std::string write_information(void) const
void set_final_solutions_errors_weights(const Vector< double > &)