GeNN  3.3.0
GPU enhanced Neuronal Networks (GeNN)
Current source models

There is a number of predefined models which can be used with the NNmodel::addCurrentSource function:

Defining your own current source model

In order to define a new current source type for use in a GeNN application, it is necessary to define a new class derived from CurrentSourceModels::Base. For convenience the methods this class should implement can be implemented using macros:

For example, using these macros, we can define a uniformly distributed noisy current source:

class UniformNoise : public CurrentSourceModels::Base
{
public:
DECLARE_MODEL(UniformNoise, 1, 0);
SET_SIM_CODE("$(injectCurrent, $(gennrand_uniform) * $(magnitude));");
SET_PARAM_NAMES({"magnitude"});
};

Previous | Top | Next