TarzaNN
TarzaNN neural network simulator
|
00001 #ifndef FEATUREPLANE_H_INCLUDED 00002 #define FEATUREPLANE_H_INCLUDED 00003 00004 #include "nowarn.h" 00005 #include "common.h" 00006 #include "Matrix.h" 00007 00008 #include "FeaturePlaneAbstract.h" 00009 #include "NotifyStrategyASync.h" 00010 #include "NotifyStrategySync.h" 00011 00012 #include "GatingUnits.h" 00013 #include "Neuron.h" 00014 #include "STNeuron.h" 00015 #include "WilsonCowanNeuron.h" 00016 #include "SpikingNeuron.h" 00017 #include "SigmoidNeuron.h" 00018 #include "TanHNeuron.h" 00019 #include "LinearNeuron.h" 00020 #include "LinearSigmoidNeuron.h" 00021 #include "Network.h" 00022 #include "FeaturePlaneAbstract.h" 00023 #include "FeaturePlaneProxy.h" 00024 #include "InputFeaturePlane.h" 00025 #include "ConstantInputFeaturePlane.h" 00026 #include "InputSocketFeaturePlane.h" 00027 #include "InputVirtualFeaturePlane.h" 00028 #include "FeaturePlaneInput.h" 00029 #include "Monitor.h" 00030 00032 class FeaturePlane : public FeaturePlaneAbstract { 00033 friend class FeaturePlaneFactory; 00034 protected: 00035 00044 // FeaturePlane(Network* net, int l, char* n, int w, int h, bool isWTA, bool visible); 00054 FeaturePlane( Network* net, int l, QString* n, int w, int h, int angles, int speeds, int alpha, int speed, bool isWTA, bool visible, Neuron* neuron, NotifyStrategyAbstract* notify); 00055 00056 public: 00058 OutputImage* getCurrentOutput(int index); 00059 00060 ~FeaturePlane(); 00061 00067 FeaturePlaneInput* addFilter(Filter* f, FeaturePlaneAbstract*fp, int type, int fpOutputIndex, bool wta); 00068 void editFeaturePlaneInput(FeaturePlaneInput* theOld, FeaturePlaneInput* theNew); 00069 void removeFeaturePlaneInput(FeaturePlaneInput* f); 00070 void removeFeaturePlaneInput(FeaturePlaneAbstract* f); 00071 void removeFeaturePlaneInputs(); 00072 00073 virtual PlaneInputs* getRegularInputList() {return ®ularInputList;} 00074 virtual PlaneInputs* getErrorInputList() {return &errorInputList;} 00075 virtual PlaneInputs* getMaskingInputList() {return &maskingInputList;} 00076 virtual PlaneInputs* getNonFourierInputList() {return &nonFourierInputList;} 00077 float getMaxActivation() {return theNeuronStrategy->getMaxActivation();} 00078 void inhibitReturn(); 00079 00080 protected: 00081 FeaturePlane(); 00083 PlaneInputs regularInputList; 00084 PlaneInputs errorInputList; 00085 PlaneInputs maskingInputList; 00086 PlaneInputs nonFourierInputList; 00087 GatingUnitsVector gatingUnitsList; 00088 00090 MatrixVector regularActivations; 00091 MatrixVector maskingActivations; 00092 MatrixVector nonFourierActivations; 00094 Matrix* totalActivation; 00095 00096 int regularInputCount, errorInputCount, maskingInputCount, nonFourierInputCount; 00098 virtual void step(); 00100 virtual void run(); 00101 00103 void applyGatingControl(); 00105 void finalize(); 00106 void sumActivations(); 00107 Matrix* tempResized; 00108 void ThreadEntry(); 00109 void _removeFeaturePlaneInputHelper1(FeaturePlaneInput* f, PlaneInputs* inputList, int& inputCount, bool deleteAll=false ); 00110 void _removeFeaturePlaneInputHelper2(FeaturePlaneAbstract* f, PlaneInputs* inputList, int& inputCount); 00111 void _editFeaturePlaneInput(FeaturePlaneInput* theOld, FeaturePlaneInput* theNew, PlaneInputs* inputList); 00112 00113 virtual void computeActivations(); 00114 void computeActivations(PlaneInputs inputPlane, MatrixVector activations); 00115 void computeActivationFromGating(PlaneInputs inputPlane, MatrixVector activations); 00116 void computeNonFourierActivations(PlaneInputs inputPlane, MatrixVector activations); 00117 virtual void sumActivations(MatrixVector regularActivations, MatrixVector nonFourierActivations, Matrix* totalActivation); 00118 void _sumActivations(MatrixVector activations, Matrix* totalActivation); 00119 void STM_sumActivations(MatrixVector activations, Matrix* totalActivation); 00120 void (FeaturePlane::*doComputeActivations)(PlaneInputs inputPlane, MatrixVector activations); 00121 void (FeaturePlane::*doSumActivations)(MatrixVector activations, Matrix* totalActivation); 00122 void computeGatingUnits(PlaneInputs inputPlane); 00123 void applyMasking(OutputImage* workOutput, MatrixVector maskingActivations, Matrix* totalActivation); 00125 void applyThreshold(Matrix* totalActivation); 00126 }; 00127 #endif //FEATUREPLANE_H_INCLUDED