GeNN  3.3.0
GPU enhanced Neuronal Networks (GeNN)
synapseModels.h
Go to the documentation of this file.
1 
2 #ifndef SYNAPSEMODELS_H
3 #define SYNAPSEMODELS_H
4 
5 #include "dpclass.h"
6 
7 #include <string>
8 #include <vector>
9 
10 using namespace std;
11 
12 
17 {
18 public:
19  string simCode;
20  string simCodeEvnt;
21  string simLearnPost;
22  string evntThreshold;
23  string synapseDynamics;
27  vector<string> varNames;
28  vector<string> varTypes;
29  vector<string> pNames;
30  vector<string> dpNames;
34  bool needPreSt;
35  bool needPostSt;
36 
39 };
40 
41 
42 // Synapse Types
43 extern vector<weightUpdateModel> weightUpdateModels;
44 extern unsigned int NSYNAPSE;
45 extern unsigned int NGRADSYNAPSE;
46 extern unsigned int LEARN1SYNAPSE;
47 const unsigned int SYNTYPENO = 4; // maximum number of synapse types: SpineML needs to know this
48 
49 
50 //--------------------------------------------------------------------------
54 //--------------------------------------------------------------------------
55 
56 class pwSTDP : public dpclass
57 {
58 public:
59  double calculateDerivedParameter(int index, vector<double> pars, double = 1.0) {
60  switch (index) {
61  case 0:
62  return lim0(pars);
63  case 1:
64  return lim1(pars);
65  case 2:
66  return slope0(pars);
67  case 3:
68  return slope1(pars);
69  case 4:
70  return off0(pars);
71  case 5:
72  return off1(pars);
73  case 6:
74  return off2(pars);
75  }
76  return -1;
77  }
78 
79 private:
80  double lim0(const vector<double> &pars) {
81  return (1/pars[4] + 1/pars[1]) * pars[0] / (2/pars[1]);
82  }
83 
84  double lim1(const vector<double> &pars) {
85  return -((1/pars[3] + 1/pars[1]) * pars[0] / (2/pars[1]));
86  }
87 
88  double slope0(const vector<double> &pars) {
89  return -2*pars[5]/(pars[1]*pars[0]);
90  }
91 
92  double slope1(const vector<double> &pars) {
93  return -1*slope0(pars);
94  }
95 
96  double off0(const vector<double> &pars) {
97  return pars[5]/pars[4];
98  }
99 
100  double off1(const vector<double> &pars) {
101  return pars[5]/pars[1];
102  }
103 
104  double off2(const vector<double> &pars) {
105  return pars[5]/pars[3];
106  }
107 };
108 
109 
110 //--------------------------------------------------------------------------
113 //--------------------------------------------------------------------------
114 
116 
117 #endif // SYNAPSEMODELS_H
vector< string > pNames
Names of (independent) parameters of the model.
Definition: synapseModels.h:29
vector< string > varNames
Names of the variables in the postsynaptic model.
Definition: synapseModels.h:27
string simCode_supportCode
Support code is made available within the synapse kernel definition file and is meant to contain user...
Definition: synapseModels.h:24
TODO This class definition may be code-generated in a future release.
Definition: synapseModels.h:56
const unsigned int SYNTYPENO
Definition: synapseModels.h:47
dpclass * dps
Definition: synapseModels.h:33
string synapseDynamics
Simulation code for synapse dynamics independent of spike detection.
Definition: synapseModels.h:23
string simCodeEvnt
Simulation code that is used for spike events (all the instances where event threshold condition is m...
Definition: synapseModels.h:20
bool needPostSt
Whether postsynaptic spike times are needed or not.
Definition: synapseModels.h:35
vector< string > extraGlobalSynapseKernelParameters
Additional parameter in the neuron kernel; it is translated to a population specific name but otherwi...
Definition: synapseModels.h:31
string simCode
Simulation code that is used for true spikes (only one time step after spike detection) ...
Definition: synapseModels.h:19
unsigned int LEARN1SYNAPSE
Variable attaching the name LEARN1SYNAPSE to the the primitive STDP model for learning.
Definition: synapseModels.cc:34
string simLearnPost_supportCode
Support code is made available within the synapse kernel definition file and is meant to contain user...
Definition: synapseModels.h:25
Definition: dpclass.h:10
unsigned int NSYNAPSE
Variable attaching the name NSYNAPSE to the non-learning synapse.
Definition: synapseModels.cc:32
string evntThreshold
Simulation code for spike event detection.
Definition: synapseModels.h:22
Class to hold the information that defines a weightupdate model (a model of how spikes affect synapti...
Definition: synapseModels.h:16
double calculateDerivedParameter(int index, vector< double > pars, double=1.0)
Definition: synapseModels.h:59
bool needPreSt
Whether presynaptic spike times are needed or not.
Definition: synapseModels.h:34
unsigned int NGRADSYNAPSE
Variable attaching the name NGRADSYNAPSE to the graded synapse wrt the presynaptic voltage...
Definition: synapseModels.cc:33
vector< string > extraGlobalSynapseKernelParameterTypes
Additional parameters in the neuron kernel; they are translated to a population specific name but oth...
Definition: synapseModels.h:32
string synapseDynamics_supportCode
Support code is made available within the synapse kernel definition file and is meant to contain user...
Definition: synapseModels.h:26
void prepareWeightUpdateModels()
Function that prepares the standard (pre) synaptic models, including their variables, parameters, dependent parameters and code strings.
Definition: synapseModels.cc:42
vector< weightUpdateModel > weightUpdateModels
Global C++ vector containing all weightupdate model descriptions.
Definition: synapseModels.cc:31
string simLearnPost
Simulation code which is used in the learnSynapsesPost kernel/function, where postsynaptic neuron spi...
Definition: synapseModels.h:21
vector< string > varTypes
Types of the variable named above, e.g. "float". Names and types are matched by their order of occurr...
Definition: synapseModels.h:28
vector< string > dpNames
Names of dependent parameters of the model.
Definition: synapseModels.h:30