@@ -112,18 +112,11 @@ We can track and visualize the conductance outputs of our two different dynamic
112112To create the simulation of a single input pulse stream, you can write the following code:
113113
114114``` 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-
123115time_span = []
124116g = []
125117ga = []
126118ctx.reset()
119+ Tsteps = int (T/ dt) + 1
127120for t in range (Tsteps):
128121 s_t = jnp.zeros((1 , 1 ))
129122 if t * dt == 1 .: # # pulse at 1 ms
@@ -156,6 +149,13 @@ matplotlib.use('Agg')
156149import matplotlib.pyplot as plt
157150cmap = plt.cm.jet
158151
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+
159159# # ---- plot the exponential synapse conductance time-course ----
160160fig, ax = plt.subplots()
161161
@@ -312,7 +312,7 @@ pre_inh.inputs.set(jnp.ones((1, n_inh)))
312312post_exc.v.set(post_exc.v.value * 0 - 65 .) # # initial condition for LIF is -65 mV
313313volts.append(post_exc.v.value)
314314time_span.append(0 .)
315- Tsteps = int (T/ dt)
315+ Tsteps = int (T/ dt) + 1
316316for t in range (1 , Tsteps):
317317 ctx.run(t = t * dt, dt = dt)
318318 print (f " \r v { post_exc.v.value} " , end = " " )
@@ -332,6 +332,16 @@ matplotlib.use('Agg')
332332import matplotlib.pyplot as plt
333333cmap = plt.cm.jet
334334
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+
335345fig, ax = plt.subplots()
336346
337347volt_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
373383 :align: center
374384
375385 +-----------------------------------------------------------------------+-----------------------------------------------------------------------+
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 |
377387 | :width: 400px | :width: 400px |
378388 | :align: center | :align: center |
379389 +-----------------------------------------------------------------------+-----------------------------------------------------------------------+
0 commit comments