Last modified by adavison on 2022/10/04 13:55

From version 12.1
edited by adavison
on 2021/09/30 14:21
Change comment: There is no comment for this version
To version 11.3
edited by adavison
on 2021/09/30 14:01
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -219,11 +219,8 @@
219 219   v_reset=RandomDistribution('normal', {'mu': -65.0, 'sigma': 1.0}), (%%)
220 220  (% style="color:#000000" %) t_refrac=1, tau_m=10, cm=1, i_offset=0.1)(%%)
221 221  (% style="color:#000000" %)population1 = sim.Population(100, cell_type, label="Population 1")(%%)
222 -(% style="color:#e74c3c" %)population2 = sim.Population(100, cell_type, label="Population 2")
223 -population2.set(i_offset=0)(%%)
224 -(% style="color:#000000" %)population1.record("v")(%%)
225 -(% style="color:#e74c3c" %)population2.record("v")(%%)
226 -(% style="color:#000000" %)sim.run(100.0)(%%)
222 +(% style="color:#000000" %)population1.record("v")
223 +sim.run(100.0)(%%)
227 227  (% style="color:#000000" %)data_v = population1.get_data().segments[0].filter(name='v')[0]
228 228  Figure(
229 229   Panel(
... ... @@ -233,128 +233,11 @@
233 233   ),
234 234   title="Response of first five neurons with heterogeneous parameters",
235 235   annotations="Simulated with NEST"
236 -).show()
233 +).show()(%%)
234 +\\**Run script in terminal, show figure**
237 237  )))
238 238  
239 -Now we want to create synaptic connections between the neurons in Population 1 and those in Population 2. There are lots of different ways these could be connected.
240 240  
241 -(% class="box successmessage" %)
242 -(((
243 -**Slide** showing all-to-all connections
244 -)))
245 -
246 -We could connect all neurons in Population 1 to all those in Population 2.
247 -
248 -(% class="box successmessage" %)
249 -(((
250 -**Slide** showing random connections
251 -)))
252 -
253 -We could connect the populations randomly, in several different ways.
254 -
255 -(% class="box successmessage" %)
256 -(((
257 -**Slide** showing distance-dependent connections
258 -)))
259 -
260 -(% class="wikigeneratedid" %)
261 -We could connect the populations randomly, but with a probability of connection that depends on the distance between the neurons.
262 -
263 -(% class="box successmessage" %)
264 -(((
265 -**Slide** showing explicit lists of connections
266 -)))
267 -
268 -(% class="wikigeneratedid" %)
269 -Or we could connect the neurons in a very specific manner, based on an explicit list of connections.
270 -
271 -(% class="wikigeneratedid" %)
272 -Just as PyNN provides a variety of neuron models, so it comes with a range of connection algorithms built in. You can also add your own connection methods.
273 -
274 -(% class="box successmessage" %)
275 -(((
276 -**Slide** showing addition of second population, and of connections between them, labelled as a Projection.
277 -)))
278 -
279 -(% class="wikigeneratedid" %)
280 -In PyNN, we call a group of connections between two populations a _Projection_. To create a Projection, we need to specify the presynaptic population, the postsynaptic population, the connection algorithm, and the synapse model. Here we're using the simplest synapse model available in PyNN, for which the synaptic weight is constant over time, there is no plasticity.
281 -
282 -(% class="box infomessage" %)
283 -(((
284 -**Screencast** - current state of editor
285 -\\(% style="color:#000000" %)"""Simple network model using PyNN"""
286 -\\import pyNN.nest as sim(%%)
287 -(% style="color:#000000" %)from pyNN.utility.plotting import Figure, Panel(%%)
288 -(% style="color:#000000" %)from pyNN.random import RandomDistribution(%%)
289 -(% style="color:#000000" %)sim.setup(timestep=0.1)(%%)
290 -(% style="color:#000000" %)cell_type  = sim.IF_curr_exp(
291 - (% style="color:#e74c3c" %) (% style="color:#000000" %)v_rest=RandomDistribution('normal', {'mu': -65.0, 'sigma': 1.0}),
292 - v_thresh=RandomDistribution('normal', {'mu': -55.0, 'sigma': 1.0}),
293 - v_reset=RandomDistribution('normal', {'mu': -65.0, 'sigma': 1.0}), (%%)
294 -(% style="color:#000000" %) t_refrac=1, tau_m=10, cm=1, i_offset=0.1)(%%)
295 -(% style="color:#000000" %)population1 = sim.Population(100, cell_type, label="Population 1")(%%)
296 -(% style="color:#000000" %)population2 = sim.Population(100, cell_type, label="Population 2")
297 -population2.set(i_offset=0)
298 -population1.record("v")
299 -population2.record("v")(%%)
300 -(% style="color:#e74c3c" %)connection_algorithm = sim.FixedProbabilityConnector(p=0.5)
301 -synapse_type = sim.StaticSynapse(weight=0.5, delay=0.5)
302 -connections = sim.Projection(population1, population2, connection_algorithm, synapse_type)(%%)
303 -(% style="color:#000000" %)sim.run(100.0)(%%)
304 -(% style="color:#000000" %)data_v = population1.get_data().segments[0].filter(name='v')[0]
305 -Figure(
306 - Panel(
307 - data_v[:, 0:5],
308 - xticks=True, xlabel="Time (ms)",
309 - yticks=True, ylabel="Membrane potential (mV)"
310 - ),
311 - title="Response of first five neurons with heterogeneous parameters",
312 - annotations="Simulated with NEST"
313 -).show()
314 -)))
315 -
316 -(% class="wikigeneratedid" %)
317 -Finally, let's update our figure, by adding a second panel to show the responses of Population 2.
318 -
319 -(% class="box infomessage" %)
320 -(((
321 -**Screencast** - current state of editor
322 -\\(% style="color:#000000" %)"""Simple network model using PyNN"""
323 -\\import pyNN.nest as sim(%%)
324 -(% style="color:#000000" %)from pyNN.utility.plotting import Figure, Panel(%%)
325 -(% style="color:#000000" %)from pyNN.random import RandomDistribution(%%)
326 -(% style="color:#000000" %)sim.setup(timestep=0.1)(%%)
327 -(% style="color:#000000" %)cell_type  = sim.IF_curr_exp(
328 - (% style="color:#e74c3c" %) (% style="color:#000000" %)v_rest=RandomDistribution('normal', {'mu': -65.0, 'sigma': 1.0}),
329 - v_thresh=RandomDistribution('normal', {'mu': -55.0, 'sigma': 1.0}),
330 - v_reset=RandomDistribution('normal', {'mu': -65.0, 'sigma': 1.0}), (%%)
331 -(% style="color:#000000" %) t_refrac=1, tau_m=10, cm=1, i_offset=0.1)(%%)
332 -(% style="color:#000000" %)population1 = sim.Population(100, cell_type, label="Population 1")(%%)
333 -(% style="color:#000000" %)population2 = sim.Population(100, cell_type, label="Population 2")
334 -population2.set(i_offset=0)
335 -population1.record("v")
336 -population2.record("v")(%%)
337 -(% style="color:#e74c3c" %)connection_algorithm = sim.FixedProbabilityConnector(p=0.5)
338 -synapse_type = sim.StaticSynapse(weight=0.5, delay=0.5)
339 -connections = sim.Projection(population1, population2, connection_algorithm, synapse_type)(%%)
340 -(% style="color:#000000" %)sim.run(100.0)(%%)
341 -(% style="color:#000000" %)data1_v = population1.get_data().segments[0].filter(name='v')[0]
342 -data2_v = population1.get_data().segments[0].filter(name='v')[0]
343 -Figure(
344 - Panel(
345 - data_v[:, 0:5],
346 - xticks=True, xlabel="Time (ms)",
347 - yticks=True, ylabel="Membrane potential (mV)"
348 - ),
349 -
350 -
351 -(% style="color:#000000" %) title="Response of first five neurons with heterogeneous parameters",
352 - annotations="Simulated with NEST"
353 -).show()
354 -
355 -**Run script in terminal, show figure**
356 -)))
357 -
358 358  (% class="wikigeneratedid" id="HSummary28Inthistutorial2CyouhavelearnedtodoX202629" %)
359 359  (% class="small" %)**Summary (In this tutorial, you have learned to do X…)**
360 360