vnormalize.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef _HPP_VNORMALIZE
  2. #define _HPP_VNORMALIZE
  3. #include "normalize.hpp"
  4. #include "vconnection.hpp"
  5. #include "layer.hpp"
  6. #include "typedefs.hpp"
  7. /*! \brief VecNormalize
  8. *
  9. * is friend class of VecConnection
  10. * normalizes synaptic weights of a VecConnection
  11. */
  12. class VecNormalize: public AbstractNormalize
  13. {
  14. protected:
  15. layer* Target;
  16. TVecConnectionList ConList; ///< Vector der zu normalisierenden Connections
  17. int NTarget;
  18. int NSource;
  19. public:
  20. VecNormalize();
  21. virtual int AddConnection(VecConnection* newcon);
  22. virtual int proceede(int =0) =0;
  23. virtual int prepare(int =0) =0;
  24. virtual int WriteSimInfo(fstream &fw);
  25. virtual int WriteSimInfo(fstream &fw, const string &ChildInfo);
  26. virtual void SetRewiring(float SynDelThreshold, float IncommingConnectivity, float InitialWeights);
  27. int Rewire();
  28. };
  29. /*! \brief VecFiringRateNormalize2
  30. *
  31. */
  32. class VecFiringRateNormalize2: public VecNormalize
  33. {
  34. protected:
  35. int* PostSynLastFirings;
  36. float Tau;
  37. float* NormLut;
  38. int NormLutN;
  39. float MaxNormFactor;
  40. float NormDeltaT;
  41. float NormFactor;
  42. float NormFrequency;
  43. public:
  44. VecFiringRateNormalize2(float NormFrequency=1, float NormFactor=0.001, float MaxNormFactor=10);
  45. virtual int AddConnection(VecConnection* newcon);
  46. virtual int proceede(int =0);
  47. virtual int prepare(int =0);
  48. virtual int WriteSimInfo(fstream &fw);
  49. };
  50. /*! \brief VecConstSumNormalize
  51. *
  52. */
  53. class VecConstSumNormalize: public VecNormalize
  54. {
  55. protected:
  56. float* PostSynWeightSum;
  57. float WeightSum;
  58. int* PostSynLastFirings;
  59. bool quadratic;
  60. public:
  61. VecConstSumNormalize(float _WeightSum=1, bool _quadratic=false);
  62. virtual int proceede(int =0);
  63. int NormalizeAll();
  64. void CalcInitWeightSum(); //calculate weight sum from initial weight distribution
  65. float GetWeightSum();
  66. int SetWeightSum(float NewWeightSum);
  67. virtual int WriteSimInfo(fstream &fw);
  68. virtual int prepare(int =0);
  69. };
  70. #endif /*_HPP_VNORMALIZE */