00001 #ifndef __SimpleFastIca__ 00002 #define __SimpleFastIca__ 00003 00028 #include "RealVector.hpp" 00029 00030 class SimpleFastIca 00031 { 00032 private: 00033 00034 RealVector* wold; 00035 RealVector* w; 00036 00037 int count; 00038 RealVector* ev3; // cummulate estimation needed in FastICA 00039 00040 double epsilon; 00041 00042 public: 00043 00044 SimpleFastIca(double eps=1.0e-4){ w=0; wold=0; count=0; epsilon=eps; } 00045 virtual ~SimpleFastIca() 00046 { 00047 if( w != 0 ) 00048 { 00049 delete w; 00050 delete wold; 00051 00052 delete ev3; 00053 } 00054 } 00055 00056 virtual RealVector* getW(){return w;} 00057 00058 // learning 00059 virtual void init(int size); 00060 00061 virtual void startLearning(){ count=0; ev3->setAll(0.0); } // to use to start a new iteration 00062 virtual void learn(RealVector* sample); 00063 virtual bool endLearning(); 00064 00065 // out 00066 virtual double forward(RealVector* src); // maximise absolute value of kurtosis 00067 00068 virtual void output() 00069 { 00070 printf("Single Simple FastICA Unit"); 00071 } 00072 }; 00073 00074 #endif