📄 alphaneuron.h
字号:
/*************************************************************************** alphaneuron.h - description ------------------- copyright : (C) 2001, 2002, 2003 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 ALPHANEURON_H#define ALPHANEURON_H#include <amygdala/spikingneuron.h>#include <amygdala/spikingneuronproperties.h>#include <amygdala/factory.h>#include <amygdala/functionlookup.h>namespace Amygdala {class AlphaNeuronProperties: public SpikingNeuronProperties {public: AlphaNeuronProperties(); AlphaNeuronProperties(bool initializePhysicalProps); AlphaNeuronProperties(const AlphaNeuronProperties& rhs); virtual ~AlphaNeuronProperties(); float GetMembraneConst() const { return memTimeConst; } void SetMembraneConst(float timeConst) { memTimeConst = timeConst; } float GetExcitatorySynapseConst() const { return eSynTimeConst; } void SetExcitatorySynapseConst(float timeConst) { eSynTimeConst = timeConst; } float GetInhibitorySynapseConst() const { return iSynTimeConst; } void SetInhibitorySynapseConst(float timeConst) { iSynTimeConst = timeConst; } virtual AlphaNeuronProperties* Copy() const; /** @see Properties::SetProperty() */ virtual void SetProperty(std::string& name, std::string& value); /** @see Properties::GetPropertyMap() */ virtual std::map< std::string, std::string > GetPropertyMap() const;protected: float memTimeConst; // Membrane time constant (ms) float eSynTimeConst; // excitatory synaptic time constant (ms) float iSynTimeConst; // inhibitory synaptic time constant (ms)};/** @class AlphaNeuron alphaneuron.h amygdala/alphaneuron.h * @brief A neuron based on the area W neurons described in * the Hopfield-Brody Mus Silicium papers. * * The neuron model derives the post-synaptic potential based * on the pre-synaptic currents. The excitatory current is modeled as * \f[ I = \frac{1}{\tau_s}exp\left(\frac{-(t + t_\delta)}{\tau_s}\right)\f] * and the inhibitory current is modeled as the alpha function * \f[ I = \frac{t + t_\delta}{\tau_{si}^2} * exp\left(\frac{-(t + t_\delta)}{\tau_{si}}\right) \f] * The synaptic time constant, \f$\tau_s\f$ is set to be 4 ms longer in inhibitory * synapses than in excitatory \f$(\tau_{si} = \tau_s + 4ms)\f$. * The value set through the API is the excitatory time constant. * This was done because the longer inhibitory constant is * needed for the correct functioning of our Mus Silicium implementation. * Amygdala 0.4 will allow excitatory and inhibitory synaptic time constants * to be set separately, elliminating the need for this kludge. * The contribution of each current to the membrane potential can be * found by integrating the currents over time. The integration is * done for AlphaNeuron by the Euler class using Euler's method with * a 10us time step. * @see Neuron, BasicNeuron, FastNeuron, Euler. * @author Matt Grover */class AlphaNeuron : public SpikingNeuron {public: typedef NeuronFactory<AlphaNeuron,AlphaNeuronProperties> Factory; virtual ~AlphaNeuron(); virtual float GetMembranePtnl() const;protected:/** @param neuronId A unique, positive integer that is used * to identify the neuron. * @param neuronProps the properties this neuron will get assigned */ AlphaNeuron(AmIdInt neuronId, const AlphaNeuronProperties& neuronProps); virtual void SetProperties(NeuronProperties* props) {SetProperties(dynamic_cast<AlphaNeuronProperties*>(props)); } void SetProperties(AlphaNeuronProperties* props);/** Send a spike to this Neuron. When spikes are * grouped, this function will only be called once per step, but * it can be called multiple times otherwise. * This should only be called from other Neurons or the Network. * @param inTime Time of input (microseconds). * @see Neuron::SendSpike(), Network::SendDelayedSpikes(). */ virtual void ProcessInput(const AmTimeInt& inTime); virtual void SpikeCleanup();/* /** Determine the maximum value of a weight for this neuron and * set maxScaledWeight to this value. This will be used * as the multiplication factor to convert to and from the * normalized weight values that are used in the public * interface. * <P>NOTE: This function will be deprecated in version 0.4 * if favor of normalizing PSP curves rather than recalculating * normalized weights. virtual void SetMaxScaledWeight() {}; */ void ScaleFunctionLookups(); void InitLookup(); void MakeLookupTables(); TableProperties GetTableProps(unsigned int index); void PrintLookupTables(); struct InputHist { AmTimeInt time; float weight; }; std::vector<InputHist> inputHist; unsigned int histBeginIdx; float* epspLookup; // Excitatory table float* edPspLookup; // Excitatory derivative table float* ipspLookup; // Inhibitory table float* idPspLookup; // Inhibitory derivative table // Needed for calculation of spike times float maxThreshCrs; float convergeRes;private: static unsigned int pspStepSize; static unsigned int pspLSize; static void Init(); template<class neuron, class neuronProperties> friend class NeuronFactory;};namespace Factory { static AlphaNeuron::Factory MakeAlphaNeuron;}} // namespace Amygdala#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -