GeNN  4.9.0
GPU enhanced Neuronal Networks (GeNN)
WeightUpdateModels::PiecewiseSTDP Class Reference

This is a simple STDP rule including a time delay for the finite transmission speed of the synapse. More...

#include <weightUpdateModels.h>

Inheritance diagram for WeightUpdateModels::PiecewiseSTDP:
WeightUpdateModels::Base Models::Base Snippet::Base

Public Member Functions

 DECLARE_WEIGHT_UPDATE_MODEL (PiecewiseSTDP, 10, 2, 0, 0)
 
virtual StringVec getParamNames () const override
 Gets names of of (independent) model parameters. More...
 
virtual VarVec getVars () const override
 Gets names and types (as strings) of model variables. More...
 
virtual std::string getSimCode () const override
 Gets simulation code run when 'true' spikes are received. More...
 
virtual std::string getLearnPostCode () const override
 Gets code to include in the learnSynapsesPost kernel/function. More...
 
virtual DerivedParamVec getDerivedParams () const override
 
virtual bool isPreSpikeTimeRequired () const override
 Whether presynaptic spike times are needed or not. More...
 
virtual bool isPostSpikeTimeRequired () const override
 Whether postsynaptic spike times are needed or not. More...
 
- Public Member Functions inherited from WeightUpdateModels::Base
virtual std::string getEventCode () const
 Gets code run when events (all the instances where event threshold condition is met) are received. More...
 
virtual std::string getSynapseDynamicsCode () const
 Gets code for synapse dynamics which are independent of spike detection. More...
 
virtual std::string getEventThresholdConditionCode () const
 Gets codes to test for events. More...
 
virtual std::string getSimSupportCode () const
 Gets support code to be made available within the synapse kernel/function. More...
 
virtual std::string getLearnPostSupportCode () const
 Gets support code to be made available within learnSynapsesPost kernel/function. More...
 
virtual std::string getSynapseDynamicsSuppportCode () const
 Gets support code to be made available within the synapse dynamics kernel/function. More...
 
virtual std::string getPreSpikeCode () const
 
virtual std::string getPostSpikeCode () const
 
virtual std::string getPreDynamicsCode () const
 Gets code to be run after presynaptic neuron update. More...
 
virtual std::string getPostDynamicsCode () const
 Gets code to be run after postsynaptic neuron update. More...
 
virtual VarVec getPreVars () const
 
virtual VarVec getPostVars () const
 
virtual bool isPreSpikeEventTimeRequired () const
 Whether presynaptic spike-like-event times are needed or not. More...
 
virtual bool isPrevPreSpikeTimeRequired () const
 Whether PREVIOUS presynaptic spike times are needed or not. More...
 
virtual bool isPrevPostSpikeTimeRequired () const
 Whether PREVIOUS postsynaptic spike times are needed or not. More...
 
virtual bool isPrevPreSpikeEventTimeRequired () const
 Whether PREVIOUS presynaptic spike-like-event times are needed or not. More...
 
size_t getPreVarIndex (const std::string &varName) const
 Find the index of a named presynaptic variable. More...
 
size_t getPostVarIndex (const std::string &varName) const
 Find the index of a named postsynaptic variable. More...
 
boost::uuids::detail::sha1::digest_type getHashDigest () const
 Update hash from model. More...
 
void validate () const
 Validate names of parameters etc. More...
 
- Public Member Functions inherited from Models::Base
size_t getVarIndex (const std::string &varName) const
 Find the index of a named variable. More...
 
- Public Member Functions inherited from Snippet::Base
virtual ~Base ()
 
virtual EGPVec getExtraGlobalParams () const
 
size_t getExtraGlobalParamIndex (const std::string &paramName) const
 Find the index of a named extra global parameter. More...
 

Additional Inherited Members

- Public Types inherited from Models::Base
typedef std::vector< VarVarVec
 
typedef std::vector< VarRefVarRefVec
 
typedef std::vector< EGPRefEGPRefVec
 
- Public Types inherited from Snippet::Base
typedef std::vector< std::string > StringVec
 
typedef std::vector< EGPEGPVec
 
typedef std::vector< ParamValParamValVec
 
typedef std::vector< DerivedParamDerivedParamVec
 
- Protected Member Functions inherited from Models::Base
void updateHash (boost::uuids::detail::sha1 &hash) const
 
void validate () const
 Validate names of parameters etc. More...
 
- Protected Member Functions inherited from Snippet::Base
void updateHash (boost::uuids::detail::sha1 &hash) const
 
void validate () const
 Validate names of parameters etc. More...
 
- Static Protected Member Functions inherited from Snippet::Base
template<typename T >
static size_t getNamedVecIndex (const std::string &name, const std::vector< T > &vec)
 

Detailed Description

This is a simple STDP rule including a time delay for the finite transmission speed of the synapse.

The STDP window is defined as a piecewise function:

LEARN1SYNAPSE_explain_html.png

The STDP curve is applied to the raw synaptic conductance gRaw, which is then filtered through the sugmoidal filter displayed above to obtain the value of g.

Note
The STDP curve implies that unpaired pre- and post-synaptic spikes incur a negative increment in gRaw (and hence in g).
The time of the last spike in each neuron, "sTXX", where XX is the name of a neuron population is (somewhat arbitrarily) initialised to -10.0 ms. If neurons never spike, these spike times are used.
It is the raw synaptic conductance gRaw that is subject to the STDP rule. The resulting synaptic conductance is a sigmoid filter of gRaw. This implies that g is initialised but not gRaw, the synapse will revert to the value that corresponds to gRaw.

An example how to use this synapse correctly is given in map_classol.cc (MBody1 userproject):

for (int i= 0; i < model.neuronN[1]*model.neuronN[3]; i++) {
if (gKCDN[i] < 2.0*SCALAR_MIN){
cnt++;
fprintf(stdout, "Too low conductance value %e detected and set to 2*SCALAR_MIN= %e, at index %d \n", gKCDN[i], 2*SCALAR_MIN, i);
gKCDN[i] = 2.0*SCALAR_MIN; //to avoid log(0)/0 below
}
scalar tmp = gKCDN[i] / myKCDN_p[5]*2.0 ;
gRawKCDN[i]= 0.5 * log( tmp / (2.0 - tmp)) /myKCDN_p[7] + myKCDN_p[6];
}
cerr << "Total number of low value corrections: " << cnt << endl;
Note
One cannot set values of g fully to 0, as this leads to gRaw= -infinity and this is not support. I.e., 'g' needs to be some nominal value > 0 (but can be extremely small so that it acts like it's 0).

The model has 2 variables:

  • g: conductance of scalar type
  • gRaw: raw conductance of scalar type

Parameters are (compare to the figure above):

  • tLrn: Time scale of learning changes
  • tChng: Width of learning window
  • tDecay: Time scale of synaptic strength decay
  • tPunish10: Time window of suppression in response to 1/0
  • tPunish01: Time window of suppression in response to 0/1
  • gMax: Maximal conductance achievable
  • gMid: Midpoint of sigmoid g filter curve
  • gSlope: Slope of sigmoid g filter curve
  • tauShift: Shift of learning curve
  • gSyn0: Value of syn conductance g decays to

Member Function Documentation

◆ DECLARE_WEIGHT_UPDATE_MODEL()

WeightUpdateModels::PiecewiseSTDP::DECLARE_WEIGHT_UPDATE_MODEL ( PiecewiseSTDP  ,
10  ,
,
,
 
)

◆ getDerivedParams()

virtual DerivedParamVec WeightUpdateModels::PiecewiseSTDP::getDerivedParams ( ) const
inlineoverridevirtual

Gets names of derived model parameters and the function objects to call to Calculate their value from a vector of model parameter values

Reimplemented from Snippet::Base.

◆ getLearnPostCode()

virtual std::string WeightUpdateModels::PiecewiseSTDP::getLearnPostCode ( ) const
inlineoverridevirtual

Gets code to include in the learnSynapsesPost kernel/function.

For examples when modelling STDP, this is where the effect of postsynaptic spikes which occur after presynaptic spikes are applied.

Reimplemented from WeightUpdateModels::Base.

◆ getParamNames()

virtual StringVec WeightUpdateModels::PiecewiseSTDP::getParamNames ( ) const
inlineoverridevirtual

Gets names of of (independent) model parameters.

Reimplemented from Snippet::Base.

◆ getSimCode()

virtual std::string WeightUpdateModels::PiecewiseSTDP::getSimCode ( ) const
inlineoverridevirtual

Gets simulation code run when 'true' spikes are received.

Reimplemented from WeightUpdateModels::Base.

◆ getVars()

virtual VarVec WeightUpdateModels::PiecewiseSTDP::getVars ( ) const
inlineoverridevirtual

Gets names and types (as strings) of model variables.

Reimplemented from Models::Base.

◆ isPostSpikeTimeRequired()

virtual bool WeightUpdateModels::PiecewiseSTDP::isPostSpikeTimeRequired ( ) const
inlineoverridevirtual

Whether postsynaptic spike times are needed or not.

Reimplemented from WeightUpdateModels::Base.

◆ isPreSpikeTimeRequired()

virtual bool WeightUpdateModels::PiecewiseSTDP::isPreSpikeTimeRequired ( ) const
inlineoverridevirtual

Whether presynaptic spike times are needed or not.

Reimplemented from WeightUpdateModels::Base.


The documentation for this class was generated from the following file: