@@ -112,18 +112,11 @@ We can track and visualize the conductance outputs of our two different dynamic
112
112
To create the simulation of a single input pulse stream, you can write the following code:
113
113
114
114
``` python
115
- time_ticks = []
116
- time_labs = []
117
- Tsteps = int (T/ dt) + 1
118
- for t in range (Tsteps):
119
- if t % 10 == 0 :
120
- time_ticks.append(t)
121
- time_labs.append(f " { t * dt:.1f } " )
122
-
123
115
time_span = []
124
116
g = []
125
117
ga = []
126
118
ctx.reset()
119
+ Tsteps = int (T/ dt) + 1
127
120
for t in range (Tsteps):
128
121
s_t = jnp.zeros((1 , 1 ))
129
122
if t * dt == 1 .: # # pulse at 1 ms
@@ -156,6 +149,13 @@ matplotlib.use('Agg')
156
149
import matplotlib.pyplot as plt
157
150
cmap = plt.cm.jet
158
151
152
+ time_ticks = []
153
+ time_labs = []
154
+ for t in range (Tsteps):
155
+ if t % 10 == 0 :
156
+ time_ticks.append(t)
157
+ time_labs.append(f " { t * dt:.1f } " )
158
+
159
159
# # ---- plot the exponential synapse conductance time-course ----
160
160
fig, ax = plt.subplots()
161
161
@@ -312,7 +312,7 @@ pre_inh.inputs.set(jnp.ones((1, n_inh)))
312
312
post_exc.v.set(post_exc.v.value * 0 - 65 .) # # initial condition for LIF is -65 mV
313
313
volts.append(post_exc.v.value)
314
314
time_span.append(0 .)
315
- Tsteps = int (T/ dt)
315
+ Tsteps = int (T/ dt) + 1
316
316
for t in range (1 , Tsteps):
317
317
ctx.run(t = t * dt, dt = dt)
318
318
print (f " \r v { post_exc.v.value} " , end = " " )
@@ -332,6 +332,16 @@ matplotlib.use('Agg')
332
332
import matplotlib.pyplot as plt
333
333
cmap = plt.cm.jet
334
334
335
+ time_ticks = []
336
+ time_labs = []
337
+ time_ticks.append(0 )
338
+ time_labs.append(f " { 0 .} " )
339
+ tdiv = 1000
340
+ for t in range (Tsteps):
341
+ if t % tdiv == 0 :
342
+ time_ticks.append(t)
343
+ time_labs.append(f " { t * dt:.0f } " )
344
+
335
345
fig, ax = plt.subplots()
336
346
337
347
volt_vals = ax.plot(time_span, volts, ' -.' , color = ' tab:red' )
@@ -373,7 +383,7 @@ Notice that the above shows the behavior of the post-synaptic LIF in response to
373
383
:align: center
374
384
375
385
+-----------------------------------------------------------------------+-----------------------------------------------------------------------+
376
- | .. image:: ../../images/tutorials/neurocog/ei_circuit_denser_exc .jpg | .. image:: ../../images/tutorials/neurocog/ei_circuit_sparse_inh.jpg |
386
+ | .. image:: ../../images/tutorials/neurocog/ei_circuit_dense_exc .jpg | .. image:: ../../images/tutorials/neurocog/ei_circuit_sparse_inh.jpg |
377
387
| :width: 400px | :width: 400px |
378
388
| :align: center | :align: center |
379
389
+-----------------------------------------------------------------------+-----------------------------------------------------------------------+
0 commit comments