Skip to content

Commit

Permalink
add Bouhadjar sequence learning network tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed Nov 16, 2024
1 parent fef8af1 commit a512881
Show file tree
Hide file tree
Showing 2 changed files with 857 additions and 909 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ model iaf_psc_exp_nonlineardendrite_neuron:
V_m mV = 0 mV # membrane potential in mV
dAP_trace pA = 0 pA # dAP trace
active_dendrite boolean = false
active_dendrite_readout real = 0.
active_dendrite_readout real = 0. # an extra readout is included so the state can be recorded in NEST; see https://github.com/nest/nestml/issues/986
dAP_counts integer = 0
ref_counts integer = 0
I_dend pA = 0 pA
Expand All @@ -41,42 +41,40 @@ model iaf_psc_exp_nonlineardendrite_neuron:
kernel I_kernel1 = exp(-1/tau_syn1*t)

# alpha shaped postsynaptic current kernel
#kernel I_kernel2 = (e/tau_syn2) * t * exp(-t/tau_syn2)
I_dend' = I_dend$ - I_dend / tau_syn2
I_dend$' = -I_dend$ / tau_syn2

# exponential shaped postsynaptic current kernel
kernel I_kernel3 = exp(-1/tau_syn3*t)

# diff. eq. for membrane potential
#recordable inline I_dend pA = convolve(I_kernel2, I_2) * pA
inline I_syn pA = convolve(I_kernel1, I_1) * pA - convolve(I_kernel3, I_3) * pA + I_e
V_m' = -(V_m - E_L)/tau_m + (I_syn + I_dend) / C_m

# diff. eq. for dAP trace
dAP_trace' = -evolve_dAP_trace * dAP_trace / tau_h

parameters:
C_m pF = 250 pF # capacity of the membrane
tau_m ms = 20 ms # membrane time constant.
C_m pF = 250 pF # capacitance of the membrane
tau_m ms = 20 ms # membrane time constant
tau_syn1 ms = 10 ms # time constant of synaptic current, port 1
tau_syn2 ms = 10 ms # time constant of synaptic current, port 2
tau_syn3 ms = 10 ms # time constant of synaptic current, port 3
tau_h ms = 400 ms # time constant of the dAP trace
V_th mV = 25 mV # spike threshold
V_reset mV = 0 mV # reset voltage
I_e pA = 0pA # external current.
E_L mV = 0mV # resting potential.
evolve_dAP_trace real = 1 # set to 0 to stop integrating dAP_trace
tau_h ms = 400 ms # time constant of the dAP trace
V_th mV = 25 mV # spike threshold
V_reset mV = 0 mV # reset voltage
E_L mV = 0mV # resting potential.
evolve_dAP_trace real = 1 # set to 0 to stop integrating dAP_trace
I_e pA = 0pA # external current.

# dendritic action potential
theta_dAP pA = 60 pA # current threshold for a dendritic action potential
I_p pA = 250 pA # current clamp value for I_dAP during a dendritic action potential
tau_dAP ms = 60 ms # time window over which the dendritic current clamp is active
I_p pA = 250 pA # current clamp value for I_dAP during a dendritic action potential
tau_dAP ms = 60 ms # time window over which the dendritic current clamp is active
dAP_timeout_ticks integer = steps(tau_dAP)

# refractory parameters
t_ref ms = 10 ms # refractory period
t_ref ms = 10 ms # refractory period
ref_timeout_ticks integer = steps(t_ref)

I_dend_incr pA/ms = pA * exp(1) / tau_syn2
Expand All @@ -91,7 +89,7 @@ model iaf_psc_exp_nonlineardendrite_neuron:
spike

onReceive(I_2):
I_dend$ += I_2 * ms * I_dend_incr * 1E6 # XXX factor 1E6?!
I_dend$ += I_2 * s * I_dend_incr

update:
# solve ODEs
Expand All @@ -114,9 +112,9 @@ model iaf_psc_exp_nonlineardendrite_neuron:
active_dendrite = false
active_dendrite_readout = 0.

# the following assignment to I_dend$ reproduces a bug in the original implementation
# the following assignment to I_dend$ reproduces a bug in the original implementation. It is included here to replicate the results of the original model
c1 real = -resolution() * exp(-resolution() / tau_syn2) / tau_syn2**2
c2 real = (-resolution() + tau_syn2)*exp(-resolution() / tau_syn2)/tau_syn2
c2 real = (-resolution() + tau_syn2) * exp(-resolution() / tau_syn2) / tau_syn2
I_dend$ = I_p * c1 / (1 - c2) / ms

else:
Expand Down
Loading

0 comments on commit a512881

Please sign in to comment.