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
-
... ... @@ -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( ... ... @@ -237,84 +237,7 @@ 237 237 \\**Run script in terminal, show figure** 238 238 ))) 239 239 240 -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. 241 241 242 -(% class="box successmessage" %) 243 -((( 244 -**Slide** showing all-to-all connections 245 -))) 246 - 247 -We could connect all neurons in Population 1 to all those in Population 2. 248 - 249 -(% class="box successmessage" %) 250 -((( 251 -**Slide** showing random connections 252 -))) 253 - 254 -We could connect the populations randomly, in several different ways. 255 - 256 -(% class="box successmessage" %) 257 -((( 258 -**Slide** showing distance-dependent connections 259 -))) 260 - 261 -(% class="wikigeneratedid" %) 262 -We could connect the populations randomly, but with a probability of connection that depends on the distance between the neurons. 263 - 264 -(% class="box successmessage" %) 265 -((( 266 -**Slide** showing explicit lists of connections 267 -))) 268 - 269 -(% class="wikigeneratedid" %) 270 -Or we could connect the neurons in a very specific manner, based on an explicit list of connections. 271 - 272 -(% class="wikigeneratedid" %) 273 -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. 274 - 275 -(% class="box successmessage" %) 276 -((( 277 -**Slide** showing addition of second population, and of connections between them, labelled as a Projection. 278 -))) 279 - 280 -(% class="wikigeneratedid" %) 281 -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. 282 - 283 -(% class="box infomessage" %) 284 -((( 285 -**Screencast** - current state of editor 286 -\\(% style="color:#000000" %)"""Simple network model using PyNN""" 287 -\\import pyNN.nest as sim(%%) 288 -(% style="color:#000000" %)from pyNN.utility.plotting import Figure, Panel(%%) 289 -(% style="color:#000000" %)from pyNN.random import RandomDistribution(%%) 290 -(% style="color:#000000" %)sim.setup(timestep=0.1)(%%) 291 -(% style="color:#000000" %)cell_type = sim.IF_curr_exp( 292 - (% style="color:#e74c3c" %) (% style="color:#000000" %)v_rest=RandomDistribution('normal', {'mu': -65.0, 'sigma': 1.0}), 293 - v_thresh=RandomDistribution('normal', {'mu': -55.0, 'sigma': 1.0}), 294 - v_reset=RandomDistribution('normal', {'mu': -65.0, 'sigma': 1.0}), (%%) 295 -(% style="color:#000000" %) t_refrac=1, tau_m=10, cm=1, i_offset=0.1)(%%) 296 -(% style="color:#000000" %)population1 = sim.Population(100, cell_type, label="Population 1")(%%) 297 -(% style="color:#000000" %)population2 = sim.Population(100, cell_type, label="Population 2") 298 -population2.set(i_offset=0) 299 -population1.record("v") 300 -population2.record("v")(%%) 301 -(% style="color:#e74c3c" %)connection_algorithm = sim.FixedProbabilityConnector(p=0.5) 302 -synapse_type = sim.StaticSynapse(weight=0.5, delay=0.5) 303 -connections = sim.Projection(population1, population2, connection_algorithm, synapse_type)(%%) 304 -(% style="color:#000000" %)sim.run(100.0)(%%) 305 -(% style="color:#000000" %)data_v = population1.get_data().segments[0].filter(name='v')[0] 306 -Figure( 307 - Panel( 308 - data_v[:, 0:5], 309 - xticks=True, xlabel="Time (ms)", 310 - yticks=True, ylabel="Membrane potential (mV)" 311 - ), 312 - title="Response of first five neurons with heterogeneous parameters", 313 - annotations="Simulated with NEST" 314 -).show()(%%) 315 -\\**Run script in terminal, show figure** 316 -))) 317 - 318 318 (% class="wikigeneratedid" id="HSummary28Inthistutorial2CyouhavelearnedtodoX202629" %) 319 319 (% class="small" %)**Summary (In this tutorial, you have learned to do X…)** 320 320