00001 #ifndef _TRAININGSET_H 00002 #define _TRAININGSET_H 00003 00004 #include "Neuron.h" 00005 #include "Network.h" 00006 00007 namespace annie 00008 { 00009 00023 class TrainingSet 00024 { 00025 protected: 00027 std::vector< VECTOR > _inputs; 00028 00030 std::vector< VECTOR > _outputs; 00031 00033 std::vector< VECTOR >::iterator _inputIter; 00034 00036 std::vector< VECTOR >::iterator _outputIter; 00037 00039 int _nInputs; 00040 00042 int _nOutputs; 00043 00045 void save_binary(const char *filename); 00046 00048 void save_text(const char *filename); 00049 00051 void load_binary(const char *filename); 00052 00054 void load_text(const char *filename); 00055 public: 00060 TrainingSet(int in,int out); 00061 00066 TrainingSet(const char *filename,int file_type = TEXT_FILE); 00067 00068 virtual ~TrainingSet(); 00069 00071 void addIOpair(real *input,real *output); 00072 00077 void addIOpair(VECTOR input,VECTOR output); 00078 00083 virtual void initialize(); 00084 00090 virtual bool epochOver(); 00091 00093 virtual int getSize(); 00094 00096 virtual int getInputSize(); 00097 00099 virtual int getOutputSize(); 00100 00116 virtual void getNextPair(VECTOR &input, VECTOR &desired); 00117 00119 friend std::ostream& operator << (std::ostream& s, TrainingSet &T); 00120 00125 virtual void save(const char *filename, int file_type = TEXT_FILE); 00126 00128 virtual const char *getClassName(); 00129 }; 00130 00131 }; //namespace annie 00132 #endif // define _TRAININGSET_H 00133
1.2.14 written by Dimitri van Heesch,
© 1997-2002