📄 trainer.h
字号:
/*************************************************************************** trainer.h - description ------------------- copyright : (C) 2005 by Matt Grover email : mgrover@amygdala.org ***************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/#ifndef TRAINER_H#define TRAINER_H#include <amygdala/amygdalaclass.h>#include <amygdala/properties.h>#include <string>#include <map>namespace Amygdala {class SpikingNeuron;class TrainerProperties: public Properties{public: TrainerProperties():Properties() {} virtual ~TrainerProperties() = 0; virtual TrainerProperties* Copy() = 0; virtual void SetProperty(const std::string& name, const std::string& value)=0; virtual std::map< std::string, std::string > GetPropertyMap() const { std::map< std::string, std::string > m; return m; }protected:};class Trainer: public AmygdalaClass{public: virtual ~Trainer() = 0; /** Callback for Network to invoke a trainer at regular intervals (used for non-Hebbian rules) */ virtual void PeriodicTrain(); void SetCallbackPeriod(AmTimeInt period); virtual void ReportSpike(SpikingNeuron* nrn)=0; virtual const std::string TrainableType() const=0; const std::string& GetName() const { return trainerName; } void SetName(std::string name) { trainerName = name; }protected: Trainer(TrainerProperties& tProps, std::string name); TrainerProperties* tprops; AmTimeInt callbackPeriod; std::string trainerName;private:};} // namespace Amygdala#endif // TRAINER_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -