OpenNN  2.2
Open Neural Networks Library
cross_entropy_error.h
1 /****************************************************************************************************************/
2 /* */
3 /* OpenNN: Open Neural Networks Library */
4 /* www.artelnics.com/opennn */
5 /* */
6 /* C R O S S E N T R O P Y 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 __CROSSENTROPYERROR_H__
15 #define __CROSSENTROPYERROR_H__
16 
17 // System includes
18 
19 #include <iostream>
20 #include <fstream>
21 #include <math.h>
22 
23 // OpenNN includes
24 
25 #include "performance_term.h"
26 #include "data_set.h"
27 
28 // TinyXml includes
29 
30 #include "../tinyxml2/tinyxml2.h"
31 
32 
33 namespace OpenNN
34 {
35 
38 
40 {
41 
42 public:
43 
44  // DEFAULT CONSTRUCTOR
45 
46  explicit CrossEntropyError(void);
47 
48  // NEURAL NETWORK CONSTRUCTOR
49 
51 
52  // DATA SET CONSTRUCTOR
53 
54  explicit CrossEntropyError(DataSet*);
55 
56  // GENERAL CONSTRUCTOR
57 
59 
60  // XML CONSTRUCTOR
61 
62  explicit CrossEntropyError(const tinyxml2::XMLDocument&);
63 
64  // COPY CONSTRUCTOR
65 
67 
68  // DESTRUCTOR
69 
70  virtual ~CrossEntropyError(void);
71 
72  // ASSIGNMENT OPERATOR
73 
75 
76  // EQUAL TO OPERATOR
77 
78  bool operator == (const CrossEntropyError&) const;
79 
80 
81  // METHODS
82 
83  // Checking methods
84 
85  void check(void) const;
86 
87  // performance methods
88 
89  double calculate_performance(void) const;
90  double calculate_performance(const Vector<double>&) const;
91 
92  double calculate_minimum_performance(void);
93 
94  double calculate_generalization_performance(void) const;
96 
99 
100  std::string write_performance_term_type(void) const;
101 
102  // Serialization methods
103 
104  tinyxml2::XMLDocument* to_XML(void) const;
105  void from_XML(const tinyxml2::XMLDocument&);
106 
107 };
108 
109 }
110 
111 #endif
112 
113 
114 // OpenNN: Open Neural Networks Library.
115 // Copyright (c) 2005-2015 Roberto Lopez.
116 //
117 // This library is free software; you can redistribute it and/or
118 // modify it under the terms of the GNU Lesser General Public
119 // License as published by the Free Software Foundation; either
120 // version 2.1 of the License, or any later version.
121 //
122 // This library is distributed in the hope that it will be useful,
123 // but WITHOUT ANY WARRANTY; without even the implied warranty of
124 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
125 // Lesser General Public License for more details.
126 
127 // You should have received a copy of the GNU Lesser General Public
128 // License along with this library; if not, write to the Free Software
129 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
double calculate_minimum_generalization_performance(void)
Vector< double > calculate_gradient(void) const
void from_XML(const tinyxml2::XMLDocument &)
double calculate_generalization_performance(void) const
bool operator==(const CrossEntropyError &) const
std::string write_performance_term_type(void) const
Returns a string with the name of the cross entropy error performance type, "CROSS_ENTROPY_ERROR".
Matrix< double > calculate_Hessian(void) const
CrossEntropyError & operator=(const CrossEntropyError &)
virtual ~CrossEntropyError(void)
Destructor.
double calculate_performance(void) const
tinyxml2::XMLDocument * to_XML(void) const