00001 #ifndef __private_MLP_h 00002 #define __private_MLP_h 00003 00004 namespace PhysicsTools { 00005 00006 class MLP { 00007 public: 00008 MLP(unsigned int nIn, unsigned int nOut, const std::string layout); 00009 ~MLP(); 00010 00011 void clear(); 00012 void init(unsigned int rows); 00013 void set(unsigned int row, double *data, double *target, double weight = 1.0); 00014 double train(); 00015 const double *eval(double *data) const; 00016 void save(const std::string file) const; 00017 void load(const std::string file); 00018 00019 inline unsigned int getEpoch() const { return epoch; } 00020 inline int getLayers() const { return layers; } 00021 inline const int *getLayout() const { return layout; } 00022 00023 private: 00024 void setLearn(void); 00025 void setNPattern(unsigned int size); 00026 00027 bool initialized; 00028 int layers; 00029 int *layout; 00030 00031 unsigned int epoch; 00032 static bool inUse; 00033 }; 00034 00035 } // namespace PhysicsTools 00036 00037 #endif // _private_MLP_h