vlearn.hpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef _HPP_VECLEARN
  2. #define _HPP_VECLEARN
  3. #include "libcsim.hpp"
  4. #include "layer.hpp"
  5. #include "vconnection.hpp"
  6. class veclearning : public SimElement
  7. {
  8. protected:
  9. layer *TargetLayer, *SourceLayer;
  10. int ns, nt; // target and source layer dimensions
  11. VecConnection *con;
  12. float maxWeight, minWeight;
  13. int Dmax;
  14. int maximumDelay;
  15. vector<float> *PSynWeights;
  16. vector<T_NNeurons>* PSynSourceNr;
  17. vector<T_NNeurons>* PSynTargetNr;
  18. vector<T_Delays>* PSynDelays;
  19. vector<vector<T_NSynapses> >* PPreSynNr;
  20. vector<vector<vector<T_NSynapses> > >* Pdelays;
  21. public:
  22. veclearning(VecConnection* con, float _maxWeight=1);
  23. ~veclearning();
  24. virtual int proceede(int)=0;
  25. virtual int prepare(int =0)=0;
  26. // virtual void SetMinWeight(float value); // removed extra qualification learning::
  27. // virtual void SetMaxWeight(float value);
  28. };
  29. class VecLearnHebbLP2: public veclearning
  30. {
  31. protected:
  32. float **LTP;
  33. float LtpDecFac;
  34. float LtpInc;
  35. bool Accumulate;
  36. float LearnSpeed;
  37. float BaseLine;
  38. public:
  39. VecLearnHebbLP2(VecConnection* con, float _MaxWeight=1, float TauDec=20, float BaseLine=0.1, float _LearnSpeed=0.001, bool _Accumulate=true);
  40. ~VecLearnHebbLP2();
  41. virtual int proceede(int =0);
  42. virtual int prepare(int =0);
  43. virtual int WriteSimInfo(fstream &fw);
  44. };
  45. class VecLearnPrePost: public veclearning
  46. {
  47. protected:
  48. float **LPpre; //presynaptic potentials
  49. float *LPpost; // postsynaptic potentials
  50. float dec_pre, dec_post; // decay of presynaptic and postsynaptic learning potential
  51. public:
  52. VecLearnPrePost(VecConnection* con, float _maxWeight=1, float TauLearnPre=30, float TauLearnPost=30);
  53. ~VecLearnPrePost();
  54. virtual int proceede(int =0)=0;
  55. virtual int prepare(int =0);
  56. };
  57. // wie LearnHebbLP2, aber mit st�rkerer Gewichts�nderung bei hoher
  58. // postsynaptischer Rate (d.h. Multiplikation der lernrate mit dem Postsynaptischen Spike Trace)
  59. // daher auch von LearnPrePost abgeleitet
  60. class VecLearnHebbLP3: public VecLearnPrePost
  61. {
  62. protected:
  63. float LearnRate, BaseLine;
  64. float LtpInc;
  65. bool Accumulate;
  66. public:
  67. VecLearnHebbLP3(VecConnection* con, float _maxWeight=1, float TauLearnPre=30, float TauLearnPost=30, float _BaseLine=0.2, float _LearnRate=0.0001, bool _Accumulate=false);
  68. virtual int proceede(int =0);
  69. };
  70. #endif /*_HPP_VECLEARN */