00001 /****************************************************************************************************************/ 00002 /* */ 00003 /* OpenNN: Open Neural Networks Library */ 00004 /* www.opennn.cimne.com */ 00005 /* */ 00006 /* I N V E R S E S U M S Q U A R E D E R R O R C L A S S H E A D E R */ 00007 /* */ 00008 /* Roberto Lopez */ 00009 /* International Center for Numerical Methods in Engineering (CIMNE) */ 00010 /* Technical University of Catalonia (UPC) */ 00011 /* Barcelona, Spain */ 00012 /* E-mail: rlopez@cimne.upc.edu */ 00013 /* */ 00014 /****************************************************************************************************************/ 00015 00016 #ifndef __INVERSESUMSQUAREDERROR_H__ 00017 #define __INVERSESUMSQUAREDERROR_H__ 00018 00019 // OpenNN includes 00020 00021 #include "../mathematical_model/mathematical_model.h" 00022 #include "../data_set/data_set.h" 00023 00024 #include "performance_term.h" 00025 00026 namespace OpenNN 00027 { 00028 00032 00033 class InverseSumSquaredError : public PerformanceTerm 00034 { 00035 00036 public: 00037 00038 // DEFAULT CONSTRUCTOR 00039 00040 explicit InverseSumSquaredError(void); 00041 00042 // NEURAL NETWORK CONSTRUCTOR 00043 00044 explicit InverseSumSquaredError(NeuralNetwork*); 00045 00046 // NEURAL NETWORK, MATHEMATICAL MODEL AND DATA SET CONSTRUCTOR 00047 00048 explicit InverseSumSquaredError(NeuralNetwork*, MathematicalModel*, DataSet*); 00049 00050 // XML CONSTRUCTOR 00051 00052 explicit InverseSumSquaredError(TiXmlElement*); 00053 00054 // DESTRUCTOR 00055 00056 virtual ~InverseSumSquaredError(void); 00057 00058 // ENUMERATIONS 00059 00061 00062 enum UnknownsMethod{LookUpTable, IndependentParametersValues}; 00063 00064 // STRUCTURES 00065 00066 // METHODS 00067 00068 // Get methods 00069 00070 const UnknownsMethod& get_unknowns_method(void) const; 00071 std::string write_unknowns_method(void) const; 00072 00073 // Set methods 00074 00075 void set_unknowns_method(const UnknownsMethod&); 00076 void set_unknowns_method(const std::string&); 00077 00078 void set_default(void); 00079 00080 // Checking methods 00081 00082 void check(void) const; 00083 00084 // Objective methods 00085 00086 double calculate_evaluation(void) const; 00087 double calculate_evaluation(const Vector<double>&) const; 00088 double calculate_generalization_evaluation(void) const; 00089 00090 std::string write_performance_term_type(void) const; 00091 00092 // Serialization methods 00093 00094 TiXmlElement* to_XML(void) const; 00095 void from_XML(TiXmlElement*); 00096 00097 private: 00098 00099 // MEMBERS 00100 00102 00103 UnknownsMethod unknowns_method; 00104 }; 00105 00106 } 00107 00108 #endif 00109 00110 00111 // OpenNN: Open Neural Networks Library. 00112 // Copyright (C) 2005-2012 Roberto Lopez 00113 // 00114 // This library is free software; you can redistribute it and/or 00115 // modify it under the terms of the GNU Lesser General Public 00116 // License as published by the Free Software Foundation; either 00117 // version 2.1 of the License, or any later version. 00118 // 00119 // This library is distributed in the hope that it will be useful, 00120 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00121 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00122 // Lesser General Public License for more details. 00123 00124 // You should have received a copy of the GNU Lesser General Public 00125 // License along with this library; if not, write to the Free Software 00126 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA