/*****************************************************************/ /** **/ /** Art1.h **/ /** Headder file for Art1 models **/ /** **/ /** Takehisa Tanaka **/ /** M.R.I.T. **/ /** revised 2/2000 **/ /*****************************************************************/ class Comparison : public NslModule { public: NslDinInt1 in; // input pattern NslDinInt1 s; // input pattern to F2 NslDoutInt1 x; // activity and topdown output pattern from F2 private: NslFloat1 v; // top-down template, or learned expectation NslFloat2 w; // LTM weights from F2 to F1 NslFloat0 rho; // vigilance parameter int active; // No. of an activated unit int resetActive; // reset computation in F1 // Functions: I think it is unnecessary to explain each function, as a // Japanese proverb says "Name shows body". public: Comparison(char*,NslModule*,int,int); ~Comparison() {} void initSys(); void initTrain(); void simTrain(); void endTrain(); }; class Recognition : public NslModule { public: NslDinInt1 in; // input pattern NslDinInt1 s; // input pattern to F2 NslDoutInt1 x; // activity and output pattern from F1 private: NslFloat1 v; // top-down template, or learned expectation NslFloat2 w; // LTM weights from F1 to F2 NslInt1 resetY; // list of reset units in F2 NslFloat0 rho; // vigilance parameter NslFloat0 l; // constant on initializing bottom-up LTM traces int active; // No. of an activated unit // Functions: I think it is unnecessary to explain each function, as a // Japanese proverb says "Name shows body". public: Recognition(char*,NslModule*,int,int); ~Recognition() {} void initSys(); void initTrain(); void simTrain(); void endTrain(); }; class Art : public NslModule { public: Comparison f1; Recognition f2; private: NslDoutInt1 in; NslDinInt1 x; NslInt2 matI; NslInt2 matX; public: Art(char*, NslModule*,int,int,int,int); ~Art(){} void makeConn(); void initTrain(); void endTrain(); }; class ArtModel : public NslModel { Art art; public: ArtModel(); ~ArtModel() {} }; // These functions are in artLib.C. extern float uniform_random(float, float); extern int vector_matrix(NslInt1&,NslInt2&); extern int matrix_vector(NslInt2&,NslInt1&);