-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add first draft for spiking neural network
- Loading branch information
C.A.P. Linssen
committed
Jan 6, 2025
1 parent
e57bf90
commit f450731
Showing
2 changed files
with
10,332 additions
and
29 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
doc/tutorials/cart_pole_reinforcement_learning/iaf_psc_exp_neuron.nestml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
""" | ||
iaf_psc_exp - Leaky integrate-and-fire neuron model | ||
################################################### | ||
|
||
Description | ||
+++++++++++ | ||
|
||
... | ||
|
||
|
||
References | ||
++++++++++ | ||
|
||
... | ||
|
||
See also | ||
++++++++ | ||
|
||
""" | ||
model iaf_psc_exp_neuron: | ||
|
||
state: | ||
V_m mV = E_l # Membrane potential | ||
g_e real = 0. | ||
|
||
equations: | ||
g_e' = -g_e / tau_g | ||
V_m' = (g_e * (E_e - V) + E_l - V + I_e + I_stim) / tau_m | ||
|
||
parameters: | ||
tau_m ms = 10 ms # Membrane time constant | ||
tau_g ms = 5 ms | ||
E_e mV = 0 mV | ||
E_l mV = -74 mV # Resting potential | ||
V_th mV = -54 mV # Spike threshold potential | ||
V_reset mV = -60 mV | ||
|
||
# constant external input current | ||
I_e real = 0 | ||
|
||
input: | ||
spikes_in_port <- spike | ||
I_stim real <- continuous | ||
|
||
output: | ||
spike | ||
|
||
update: | ||
integrate_odes() | ||
|
||
onReceive(spikes_in_port): | ||
g_e += spikes_in_port * s | ||
|
||
onCondition(V_m >= V_th): | ||
# threshold crossing | ||
V_m = V_reset | ||
emit_spike() |
Oops, something went wrong.