00001 /****************************************************************************************************************/ 00002 /* */ 00003 /* OpenNN: Open Neural Networks Library */ 00004 /* www.opennn.cimne.com */ 00005 /* */ 00006 /* O U T P U T S I N T E G R A L S 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 __OUTPUTSINTEGRALS_H__ 00017 #define __OUTPUTSINTEGRALS_H__ 00018 00019 // OpenNN includes 00020 00021 #include "performance_functional.h" 00022 #include "../utilities/numerical_integration.h" 00023 00024 namespace OpenNN 00025 { 00026 00031 00032 class OutputsIntegrals : public PerformanceTerm 00033 { 00034 00035 public: 00036 00037 // DEFAULT CONSTRUCTOR 00038 00039 explicit OutputsIntegrals(void); 00040 00041 // NEURAL NETWORK CONSTRUCTOR 00042 00043 explicit OutputsIntegrals(NeuralNetwork*); 00044 00045 // XML CONSTRUCTOR 00046 00047 explicit OutputsIntegrals(TiXmlElement*); 00048 00049 // DESTRUCTOR 00050 00051 virtual ~OutputsIntegrals(void); 00052 00053 // METHODS 00054 00055 // Get methods 00056 00057 const NumericalIntegration& get_numerical_integration(void) const; 00058 NumericalIntegration* get_numerical_integration_pointer(void); 00059 00060 const Vector<double>& get_outputs_integrals_weights(void) const; 00061 const double& get_output_integral_weight(const unsigned int&) const; 00062 00063 // Set methods 00064 00065 void set_numerical_integration(const NumericalIntegration&); 00066 00067 void set_outputs_integrals_weights(const Vector<double>&); 00068 void set_output_integral_weight(const unsigned int&, const double&); 00069 00070 void set_default(void); 00071 00072 // Checking methods 00073 00074 void check(void) const; 00075 00076 // Regularization methods 00077 00078 double calculate_evaluation(void) const; 00079 double calculate_evaluation(const Vector<double>&) const; 00080 00081 Vector<double> calculate_gradient(void) const; 00082 00083 Matrix<double> calculate_Hessian(void) const; 00084 00085 std::string write_performance_term_type(void) const; 00086 00087 // Serialization methods 00088 00089 TiXmlElement* to_XML(void) const; 00090 00091 void from_XML(TiXmlElement*); 00092 00093 private: 00094 00096 00097 NumericalIntegration numerical_integration; 00098 00100 00101 Vector<double> outputs_integrals_weights; 00102 00103 }; 00104 00105 } 00106 00107 #endif 00108 00109 00110 // OpenNN: Open Neural Networks Library. 00111 // Copyright (C) 2005-2012 Roberto Lopez 00112 // 00113 // This library is free software; you can redistribute it and/or 00114 // modify it under the terms of the GNU Lesser General Public 00115 // License as published by the Free Software Foundation; either 00116 // version 2.1 of the License, or any later version. 00117 // 00118 // This library is distributed in the hope that it will be useful, 00119 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00120 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00121 // Lesser General Public License for more details. 00122 00123 // You should have received a copy of the GNU Lesser General Public 00124 // License along with this library; if not, write to the Free Software 00125 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA