File tree 2 files changed +12
-4
lines changed
ngclearn/components/synapses 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,9 @@ class AlphaSynapse(DenseSynapse): ## dynamic alpha synapse cable
40
40
41
41
g_syn_bar: maximum conductance elicited by each incoming spike ("synaptic weight")
42
42
43
- syn_rest: synaptic reversal potential
43
+ syn_rest: synaptic reversal potential; note, if this is set to `None`, then this
44
+ synaptic conductance model will no longer be voltage-dependent (and will ignore
45
+ the voltage compartment provided by an external spiking cell)
44
46
45
47
weight_init: a kernel to drive initialization of this synaptic cable's values;
46
48
typically a tuple with 1st element as a string calling the name of
@@ -96,7 +98,9 @@ def advance_state(
96
98
dgsyn_dt = - g_syn / tau_syn + h_syn # or -g_syn/tau_syn + h_syn/tau_syn
97
99
g_syn = g_syn + dgsyn_dt * dt ## run Euler step to move conductance g
98
100
99
- i_syn = - g_syn * (v - syn_rest )
101
+ i_syn = - g_syn
102
+ if syn_rest is not None :
103
+ i_syn = - g_syn * (v - syn_rest )
100
104
outputs = i_syn #jnp.matmul(inputs, Wdyn * Rscale) + biases
101
105
return outputs , i_syn , g_syn , h_syn
102
106
Original file line number Diff line number Diff line change @@ -39,7 +39,9 @@ class ExponentialSynapse(DenseSynapse): ## dynamic exponential synapse cable
39
39
40
40
g_syn_bar: maximum conductance elicited by each incoming spike ("synaptic weight")
41
41
42
- syn_rest: synaptic reversal potential
42
+ syn_rest: synaptic reversal potential; note, if this is set to `None`, then this
43
+ synaptic conductance model will no longer be voltage-dependent (and will ignore
44
+ the voltage compartment provided by an external spiking cell)
43
45
44
46
weight_init: a kernel to drive initialization of this synaptic cable's values;
45
47
typically a tuple with 1st element as a string calling the name of
@@ -90,7 +92,9 @@ def advance_state(
90
92
_out = jnp .matmul (s , weights ) ## sum all pre-syn spikes at t going into post-neuron)
91
93
dgsyn_dt = - g_syn / tau_syn + _out * g_syn_bar
92
94
g_syn = g_syn + dgsyn_dt * dt ## run Euler step to move conductance
93
- i_syn = - g_syn * (v - syn_rest )
95
+ i_syn = - g_syn
96
+ if syn_rest is not None :
97
+ i_syn = - g_syn * (v - syn_rest )
94
98
outputs = i_syn #jnp.matmul(inputs, Wdyn * Rscale) + biases
95
99
return outputs , i_syn , g_syn
96
100
You can’t perform that action at this time.
0 commit comments