I define a neuron group with adaptive threshold and need to save the threshold after the training. Could you instruct on how to save those thresholds into a file and load it later when testing?
Here are some more details:
self.eqs_neuron = '''
dv/dt = (ge*(Ee-v) + gi*(Ei-v)+ El - v)/tau_m : volt (unless refractory)
dvt/dt = (v_thres-vt)/tau_adpt : volt
dge/dt = -ge/tau_ge : 1 (unless refractory)
dgi/dt = -gi/tau_gi : 1 (unless refractory)
delta_vt: volt (constant)
v_rest: volt (constant)
v_thres: volt (constant)
v_reset: volt (constant)
refrac_time: second (constant)
label : integer
is_correct : boolean
correct_label : integer (shared)
x: 1
y: 1
tau_m: second (constant)
Ee: volt (constant)
Ei: volt (constant)
El: volt (constant)
'''
neurons = NeuronGroup(n, self.eqs_neuron, threshold='v>vt', reset=self.reset, refractory='refrac_time')
neurons.vt = self.v_thres
I need to save the “vt” and load it later.
Thanks