Changes for page 03. Building and simulating a simple model
Last modified by adavison on 2022/10/04 13:55
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -233,7 +233,8 @@ 233 233 ), 234 234 title="Response of first five neurons with heterogeneous parameters", 235 235 annotations="Simulated with NEST" 236 -).show() 236 +).show()(%%) 237 +\\**Run script in terminal, show figure** 237 237 ))) 238 238 239 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. ... ... @@ -310,54 +310,10 @@ 310 310 ), 311 311 title="Response of first five neurons with heterogeneous parameters", 312 312 annotations="Simulated with NEST" 313 -).show() 314 +).show()(%%) 315 +\\**Run script in terminal, show figure** 314 314 ))) 315 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:#000000" %)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:#e74c3c" %)data1_v(% style="color:#000000" %) = population1.get_data().segments[0].filter(name='v')[0](%%) 342 -(% style="color:#e74c3c" %)data2_v = population2.get_data().segments[0].filter(name='v')[0](%%) 343 -(% style="color:#000000" %)Figure( 344 - Panel( 345 - (% style="color:#e74c3c" %)data1_v(% style="color:#000000" %)[:, 0:5], 346 - xticks=True, (% style="color:#e74c3c" %)--xlabel="Time (ms)",--(%%) 347 -(% style="color:#000000" %) yticks=True, ylabel="Membrane potential (mV)" 348 - ), 349 - (% style="color:#e74c3c" %)Panel( 350 - data2_v[:, 0:5], 351 - xticks=True, xlabel="Time (ms)", 352 - yticks=True" 353 - ),(%%) 354 -(% style="color:#000000" %) title="Response of (% style="color:#e74c3c" %)simple network(% style="color:#000000" %)", 355 - annotations="Simulated with NEST" 356 -).show() 357 - 358 -**Run script in terminal, show figure** 359 -))) 360 - 361 361 (% class="wikigeneratedid" id="HSummary28Inthistutorial2CyouhavelearnedtodoX202629" %) 362 362 (% class="small" %)**Summary (In this tutorial, you have learned to do X…)** 363 363