Autoencoder.h

00001 #ifndef __AUTOENCODER_
00002 #define __AUTOENCODER_
00003 
00004 #include "Algorithm.h"
00005 #include "AutomaticParameterTuner.h"
00006 #include "StandardAlgorithm.h"
00007 #include "Framework.h"
00008 #include "nnrbm.h"
00009 
00010 using namespace std;
00011 
00022 class Autoencoder : public Algorithm, public AutomaticParameterTuner, public Framework
00023 {
00024 public:
00025     Autoencoder();
00026     ~Autoencoder();
00027 
00028     virtual double train();
00029     void readMaps();
00030     void modelInit();
00031     void modelUpdate ( REAL* input, REAL* target, uint nSamples, uint crossRun );
00032     void predictAllOutputs ( REAL* rawInputs, REAL* outputs, uint nSamples, uint crossRun );
00033     void readSpecificMaps();
00034     void saveWeights();
00035     void loadWeights();
00036     virtual double calcRMSEonProbe();
00037     virtual double calcRMSEonBlend()
00038     {
00039         return 0.0;
00040     };
00041     virtual void setPredictionMode ( int cross ) {};
00042     virtual void predictMultipleOutputs ( REAL* rawInput, REAL* effect, REAL* output, int* label, int nSamples, int crossRun ) {};
00043     virtual void saveBestPrediction() {};
00044 
00045     void readDataset ( Data* data, string datasetName );
00046     void loadNormalizations();
00047 
00048     static string templateGenerator ( int id, string preEffect, int nameID, bool blendStop );
00049 
00050 private:
00051     // inputs/targets
00052     REAL** m_inputs;
00053 
00054     // the NNs
00055     NNRBM** m_nn;
00056     int m_epoch;
00057 
00058     // RBM setup
00059     bool *m_isFirstEpoch;
00060 
00061     // dsc file
00062     int m_maxTuninigEpochs;
00063     int m_minTuninigEpochs;
00064     int m_nrLayer;
00065     int m_batchSize;
00066     int m_nFixEpochs;
00067     double m_offsetOutputs;
00068     double m_scaleOutputs;
00069     double m_initWeightFactor;
00070     double m_learnrate;
00071     double m_learnrateMinimum;
00072     double m_learnrateSubtractionValueAfterEverySample;
00073     double m_learnrateSubtractionValueAfterEveryEpoch;
00074     double m_momentum;
00075     double m_weightDecay;
00076     double m_minUpdateErrorBound;
00077     double m_etaPosRPROP;
00078     double m_etaNegRPROP;
00079     double m_minUpdateRPROP;
00080     double m_maxUpdateRPROP;
00081     bool m_enableL1Regularization;
00082     bool m_enableErrorFunctionMAE;
00083     bool m_enableRPROP;
00084     bool m_useBLASforTraining;
00085     string m_neuronsPerLayer;
00086 
00087     REAL* m_meanRBM;
00088     REAL* m_stdRBM;
00089 };
00090 
00091 
00092 #endif

Generated on Tue Jan 26 09:20:58 2010 for ELF by  doxygen 1.5.8