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
-
... ... @@ -133,7 +133,7 @@ 133 133 title="Response of neuron #0", 134 134 annotations="Simulated with NEST" 135 135 ).show()(%%) 136 -\\**Run script in terminal** 136 +\\**Run script in terminal, show figure** 137 137 ))) 138 138 139 139 As you'd expect, the bias current causes the membrane voltage to increase until it reaches threshold~-~--it doesn't increase in a straight line because it's a //leaky// integrate-and-fire neuron~-~--then once it hits the threshold the voltage is reset, and then stays at the same level for a short time~-~--this is the refractory period~-~--before it starts to increase again. ... ... @@ -140,8 +140,61 @@ 140 140 141 141 Now, all 100 neurons in our population are identical, so if we plotted the first neuron, the second neuron, ..., we'd get the same trace. 142 142 143 -Let's change that. In nature every neuron is a little bit different, so let's set the resting membrane potential and the spike threshold randomly from a Gaussian distribution, and let's plot membrane voltage from _all_ the neurons. 143 +(% class="box infomessage" %) 144 +((( 145 +**Screencast** - current state of editor 146 +\\(% style="color:#000000" %)"""Simple network model using PyNN""" 147 +\\import pyNN.nest as sim(%%) 148 +(% style="color:#000000" %)from pyNN.utility.plotting import Figure, Panel(%%) 149 +(% style="color:#000000" %)sim.setup(timestep=0.1)(%%) 150 +(% style="color:#000000" %)cell_type = sim.IF_curr_exp(v_rest=-65, v_thresh=-55, v_reset=-65, t_refrac=1, tau_m=10, cm=1, i_offset=0.1)(%%) 151 +(% style="color:#000000" %)population1 = sim.Population(100, cell_type, label="Population 1") 152 +population1.record("v") 153 +sim.run(100.0)(%%) 154 +(% style="color:#000000" %)data_v = population1.get_data().segments[0].filter(name='v')[0] 155 +Figure( 156 + Panel( 157 + data_v[:, (% style="color:#e74c3c" %)0:5(% style="color:#000000" %)], 158 + xticks=True, xlabel="Time (ms)", 159 + yticks=True, ylabel="Membrane potential (mV)" 160 + ), 161 + title="Response of (% style="color:#e74c3c" %)first five neurons(% style="color:#000000" %)", 162 + annotations="Simulated with NEST" 163 +).show()(%%) 164 +\\**Run script in terminal, show figure** 165 +))) 144 144 167 +Let's change that. In nature every neuron is a little bit different, so let's set the resting membrane potential and the spike threshold randomly from a Gaussian distribution. 168 + 169 +(% class="box infomessage" %) 170 +((( 171 +**Screencast** - current state of editor 172 +\\(% style="color:#000000" %)"""Simple network model using PyNN""" 173 +\\import pyNN.nest as sim(%%) 174 +(% style="color:#000000" %)from pyNN.utility.plotting import Figure, Panel(%%) 175 +(% style="color:#e74c3c" %)from pyNN.random import RandomDistribution(%%) 176 +(% style="color:#000000" %)sim.setup(timestep=0.1)(%%) 177 +(% style="color:#000000" %)cell_type = sim.IF_curr_exp( 178 + (% style="color:#e74c3c" %) v_rest=RandomDistribution('normal', {'mu': -65.0, 'sigma': 1.0}), 179 + v_thresh=RandomDistribution('normal', {'mu': -55.0, 'sigma': 1.0}), 180 + v_reset=RandomDistribution('normal', {'mu': -65.0, 'sigma': 1.0}), (%%) 181 +(% style="color:#000000" %) t_refrac=1, tau_m=10, cm=1, i_offset=0.1)(%%) 182 +(% style="color:#000000" %)population1 = sim.Population(100, cell_type, label="Population 1") 183 +population1.record("v") 184 +sim.run(100.0)(%%) 185 +(% style="color:#000000" %)data_v = population1.get_data().segments[0].filter(name='v')[0] 186 +Figure( 187 + Panel( 188 + data_v[:, 0:5], 189 + xticks=True, xlabel="Time (ms)", 190 + yticks=True, ylabel="Membrane potential (mV)" 191 + ), 192 + title="Response of first five neurons (% style="color:#e74c3c" %)with heterogeneous parameters(% style="color:#000000" %)", 193 + annotations="Simulated with NEST" 194 +).show()(%%) 195 +\\**Run script in terminal, show figure** 196 +))) 197 + 145 145 Now if we run our simulation again, we can see the effect of this heterogeneity in the neuron population. 146 146 147 147 TO BE COMPLETED