|
116 | 116 | "of the current is added over a number of timesteps, with the current decaying exponentially between each.\n",
|
117 | 117 | "A longer decay rate will result in more charge being added overall per spike that crosses the synapse.\n",
|
118 | 118 | "\n",
|
119 |
| - "In the above example, the default parameters of the IF_curr_exp are used. These are shown below." |
120 |
| - ] |
121 |
| - }, |
122 |
| - { |
123 |
| - "cell_type": "code", |
124 |
| - "execution_count": null, |
125 |
| - "metadata": {}, |
126 |
| - "outputs": [], |
127 |
| - "source": [ |
| 119 | + "In the above example, the default parameters of the IF_curr_exp are used. These are shown below.\n", |
| 120 | + "\n", |
| 121 | + "```\n", |
128 | 122 | "lif_curr_exp_params = {\n",
|
129 | 123 | " 'cm': 1.0, # The capacitance of the LIF neuron in nano-Farads\n",
|
130 | 124 | " 'tau_m': 20.0, # The time-constant of the RC circuit, in milliseconds\n",
|
|
135 | 129 | " 'tau_syn_E': 5.0, # The excitatory input current decay time-constant\n",
|
136 | 130 | " 'tau_syn_I': 5.0, # The inhibitory input current decay time-constant\n",
|
137 | 131 | " 'i_offset': 0.0, # A base input current to add each timestep\n",
|
138 |
| - "}" |
| 132 | + "}\n", |
| 133 | + "```" |
139 | 134 | ]
|
140 | 135 | },
|
141 | 136 | {
|
|
147 | 142 | "value of the membrane voltage; the higher the membrane voltage, the more input is required to cause a\n",
|
148 | 143 | "spike. This is modelled as the reversal potential of the synapse; when the membrane potential equals the\n",
|
149 | 144 | "reversal potential, no current will flow across the synapse. A conductance-based version of the LIF model\n",
|
150 |
| - "is provided, which, in addition to the above parameters, also supports the following." |
151 |
| - ] |
152 |
| - }, |
153 |
| - { |
154 |
| - "cell_type": "code", |
155 |
| - "execution_count": null, |
156 |
| - "metadata": {}, |
157 |
| - "outputs": [], |
158 |
| - "source": [ |
| 145 | + "is provided, which, in addition to the above parameters, also supports the following.", |
| 146 | + "\n", |
| 147 | + "```\n", |
159 | 148 | "lif_cond_exp_extra_params = {\n",
|
160 | 149 | " 'e_rev_E': 0., # The reversal potential of the excitatory synapse\n",
|
161 | 150 | " 'e_rev_I': -80.0 # The reversal potential of the inhibitory synapse\n",
|
162 |
| - "}" |
| 151 | + "}\n", |
| 152 | + "```" |
163 | 153 | ]
|
164 | 154 | },
|
165 | 155 | {
|
|
168 | 158 | "source": [
|
169 | 159 | "The initial value of the state variables of the neural model can also be set (such as the membrane voltage).\n",
|
170 | 160 | "This is done via the initialize function of the population, which takes the name of the state variable (e.g. v\n",
|
171 |
| - "for the membrane voltage), and the value to be assigned e.g. the initial voltage can be set to -65.0mV as follows." |
172 |
| - ] |
173 |
| - }, |
174 |
| - { |
175 |
| - "cell_type": "code", |
176 |
| - "execution_count": null, |
177 |
| - "metadata": {}, |
178 |
| - "outputs": [], |
179 |
| - "source": [ |
180 |
| - "pop_1.initialize(v=-65.0)" |
| 161 | + "for the membrane voltage), and the value to be assigned e.g. the initial voltage can be set to -65.0mV as follows.\n", |
| 162 | + "```\n", |
| 163 | + "pop_1.initialize(v=-65.0)\n", |
| 164 | + "```" |
181 | 165 | ]
|
182 | 166 | },
|
183 | 167 | {
|
|
208 | 192 | "\n",
|
209 | 193 | "As well as a connector the Projection must also have a synapse_type which determines how the synapse\n",
|
210 | 194 | "behaves when spikes are received. For example a StaticSynapse which has fixed weights and delays is\n",
|
211 |
| - "specified as shown below." |
212 |
| - ] |
213 |
| - }, |
214 |
| - { |
215 |
| - "cell_type": "code", |
216 |
| - "execution_count": null, |
217 |
| - "metadata": {}, |
218 |
| - "outputs": [], |
219 |
| - "source": [ |
| 195 | + "specified as shown below.\n", |
220 | 196 | "synapse_type=sim.StaticSynapse(weight=0.75, delay=1.0)"
|
221 | 197 | ]
|
222 | 198 | },
|
|
326 | 302 | "### STDP in PyNN\n",
|
327 | 303 | "The steps for creating a network using STDP are much the same as previously described, with the main\n",
|
328 | 304 | "difference being that some of the projections use a STDPMechanism to describe the plasticity. Below is an\n",
|
329 |
| - "example of the creation of a projection with STDP." |
330 |
| - ] |
331 |
| - }, |
332 |
| - { |
333 |
| - "cell_type": "code", |
334 |
| - "execution_count": null, |
335 |
| - "metadata": {}, |
336 |
| - "outputs": [], |
337 |
| - "source": [ |
| 305 | + "example of the creation of a projection with STDP.\n", |
| 306 | + "\n", |
| 307 | + "```\n", |
338 | 308 | "timing_rule = sim.SpikePairRule(tau_plus=20.0, tau_minus=20.0, A_plus=0.5, A_minus=0.5)\n",
|
339 | 309 | "weight_rule = sim.AdditiveWeightDependence(w_max=5.0, w_min=0.0)\n",
|
340 | 310 | "stdp_model = sim.STDPMechanism(timing_dependence=timing_rule, weight_dependence=weight_rule, weight=0.0, delay=5.0)\n",
|
341 |
| - "stdp_projection = sim.Projection(input, pop_1, sim.OneToOneConnector(), synapse_type=stdp_model)" |
| 311 | + "stdp_projection = sim.Projection(input, pop_1, sim.OneToOneConnector(), synapse_type=stdp_model)\n", |
| 312 | + "```" |
342 | 313 | ]
|
343 | 314 | },
|
344 | 315 | {
|
|
423 | 394 | " - Create an STDP curve graph using a SpikeSourceArray stimulating a LIF population, with varying spike times for the SpikeSourceArray.\n",
|
424 | 395 | " - See the notebook for further extensions.\n"
|
425 | 396 | ]
|
426 |
| - }, |
427 |
| - { |
428 |
| - "cell_type": "code", |
429 |
| - "execution_count": null, |
430 |
| - "metadata": {}, |
431 |
| - "outputs": [], |
432 |
| - "source": [] |
433 | 397 | }
|
434 | 398 | ],
|
435 | 399 | "metadata": {
|
436 |
| - "kernelspec": { |
437 |
| - "display_name": "EBRAINS-experimental", |
438 |
| - "language": "python", |
439 |
| - "name": "ebrains-experimental" |
440 |
| - }, |
441 |
| - "title": "Running PyNN Simulations on SpiNNaker" |
442 | 400 | },
|
443 | 401 | "nbformat": 4,
|
444 | 402 | "nbformat_minor": 2
|
|
0 commit comments