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