@@ -108,7 +108,7 @@ for ts in range(T):
108108 x_t = data
109109 # # pass in t and dt and run step forward of simulation
110110 clamp(x_t)
111- advance_process.run(t = t, dt = dt) #
111+ advance_process.run(t = t, dt = dt) # run one step of dynamics
112112 t = t + dt
113113
114114 # # naively extract simple statistics at time ts and print them to I/O
@@ -143,26 +143,27 @@ recov_rec = np.squeeze(np.asarray(recov_rec))
143143spk_rec = np.squeeze(np.asarray(spk_rec))
144144
145145# Plot the AdEx cell trajectory
146- cell_tag = " RS"
147146n_plots = 1
148147fig, ax = plt.subplots(1 , n_plots, figsize = (5 * n_plots,5 ))
149148ax_ptr = ax
150- ax_ptr.set(xlabel = ' Time' , ylabel = ' Voltage (v)' ,
151- title = " AdEx ({} ) Voltage Dynamics" .format(cell_tag))
149+ ax_ptr.set(
150+ xlabel = ' Time' , ylabel = ' Voltage (v)' , title = " AdEx Voltage Dynamics"
151+ )
152152
153153v = ax_ptr.plot(time_span, mem_rec, color = ' C0' )
154154ax_ptr.legend([v[0 ]],[' v' ])
155155plt.tight_layout()
156- plt.savefig(" {0} " .format(" adex_v_plot.jpg" .format(cell_tag.lower()) ))
156+ plt.savefig(" {0} " .format(" adex_v_plot.jpg" ))
157157
158158fig, ax = plt.subplots(1 , n_plots, figsize = (5 * n_plots,5 ))
159159ax_ptr = ax
160- ax_ptr.set(xlabel = ' Time' , ylabel = ' Recovery (w)' ,
161- title = " AdEx ({} ) Recovery Dynamics" .format(cell_tag))
160+ ax_ptr.set(
161+ xlabel = ' Time' , ylabel = ' Recovery (w)' , title = " AdEx Recovery Dynamics"
162+ )
162163w = ax_ptr.plot(time_span, recov_rec, color = ' C1' , alpha = .5 )
163164ax_ptr.legend([w[0 ]],[' w' ])
164165plt.tight_layout()
165- plt.savefig(" {0} " .format(" adex_w_plot.jpg" .format(cell_tag.lower()) ))
166+ plt.savefig(" {0} " .format(" adex_w_plot.jpg" ))
166167plt.close()
167168```
168169
@@ -187,27 +188,6 @@ however, one could configure it to use the midpoint method for integration
187188by setting its argument ` integration_type = rk2 ` in cases where more
188189accuracy in the dynamics is needed (at the cost of additional computational time).
189190
190- ## Optional: Setting Up The Components with a JSON Configuration
191-
192- While you are not required to create a JSON configuration file for ngc-learn,
193- to get rid of the warning that ngc-learn will throw at the start of your
194- program's execution (indicating that you do not have a configuration set up yet),
195- all you need to do is create a sub-directory for your JSON configuration
196- inside of your project code's directory, i.e., ` json_files/modules.json ` .
197- Inside the JSON file, you would write the following:
198-
199- ``` json
200- [
201- {"absolute_path" : " ngclearn.components" ,
202- "attributes" : [
203- {"name" : " AdExCell" }]
204- },
205- {"absolute_path" : " ngcsimlib.operations" ,
206- "attributes" : [
207- {"name" : " overwrite" }]
208- }
209- ]
210- ```
211191
212192## References
213193
0 commit comments