You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,8 +86,7 @@ important hyper-parameters to configure:
78
86
excitatory nature for non-negative values of `syn_rest` or a synapse with an inhibitory
79
87
nature for negative values of `syn_rest`.
80
88
81
-
82
-
The flow of electrical current from a pre-synaptic neuron to a post-synaptic one is often modeled under the assumption that pre-synaptic pulses result in impermanent (transient; lasting for a short period of time) changes in the conductance of a post-synaptic neuron. As a result, the resulting conductance dynamics $g_{\text{syn}}(t)$ of each of the two synapses that you have built above can be simulated in ngc-learn according to one or more ordinary differential equations (ODEs).
89
+
The flow of electrical current from a pre-synaptic neuron to a post-synaptic one is often modeled under the assumption that pre-synaptic pulses result in impermanent (transient; lasting for a short period of time) changes in the conductance of a post-synaptic neuron. As a result, the resulting conductance dynamics $g_{\text{syn}}(t)$ -- or the effect (conductance changes in the post-synaptic membrane) of a transmitter binding to and opening post-synaptic receptors -- of each of the two synapses that you have built above can be simulated in ngc-learn according to one or more ordinary differential equations (ODEs), which themselves iteratively model different waveform equations of the time-course of synaptic conductance.
83
90
For the exponential synapse, the dynamics adhere to the following ODE:
84
91
85
92
$$
@@ -96,13 +103,14 @@ $$
96
103
97
104
where $h_{\text{syn}}(t)$ is an intermediate variable that operates in service of driving the conductance variable $g_{\text{syn}}(t)$ itself.
98
105
99
-
For both the exponential and the alpha synapse, the changes in conductance are finally converted (via Ohm's law) to electrical current to produce the final derived variable $j_{\text{syn}}(t)$:
106
+
Finally, we seek model the electrical current that results from some amount of neurotransmitter in previous time steps.
107
+
Thus, for both the exponential and the alpha synapse, the changes in conductance are finally converted (via Ohm's law) to electrical current to produce the final derived variable $j_{\text{syn}}(t)$:
where $v_{\text{rest}$ (or $E_{\text{rest}}$) is the post-synaptic reverse potential of the synapse; this is typically set to $E_{\text{rest}} = 0$ (millivolts; mV)for the case of excitatory changes and $E_{\text{rest}} = -75$ (mV) for the case of inhibitory changes. $v(t)$ is the voltage/membrane potential of the post-synaptic the synaptic cable wires to, meaning that the conductance models above are voltage-dependent (in ngc-learn, if one wants voltage-independent conductance, then `syn_rest` must be set to `None`).
113
+
where $v_{\text{rest}$ (or $E_{\text{rest}}$) is the post-synaptic reverse potential of the ion channels that mediate the synaptic current; this is typically set to $E_{\text{rest}} = 0$ (millivolts; mV)for the case of excitatory changes and $E_{\text{rest}} = -75$ (mV) for the case of inhibitory changes. $v(t)$ is the voltage/membrane potential of the post-synaptic the synaptic cable wires to, meaning that the conductance models above are voltage-dependent (in ngc-learn, if you want voltage-independent conductance, then set `syn_rest = None`).
106
114
107
115
108
116
### Examining the Conductances of Dynamic Synapses
@@ -187,13 +195,179 @@ expoential and alpha synapse conductance trajectories:
where $g_{L}$ is the leak conductance value for the post-synaptic LIF, $g_{E}(t)$ is the post-synaptic conductance produced by excitatory pre-synaptic spike trains (with excitatory synaptic reverse potential $E_{E}$), and $g_{I}(t)$ is the post-synaptic conductance produced by inhibitory pre-synaptic spike trains (with inhibitory synaptic reverse potential $E_{I}$). Note that the first term of the above ODE is the normal leak portion of the LIF's standard dynamics (scaled by conductance factor $g_{L}$) and the last two terms of the above ODE can be modeled each separately with a dynamic synapse. To differentiate between excitatory and inhibitory conductance changes, we will just configure a different reverse potential for each to induce either excitatory (i.e., $E_{\text{syn}} = E_{E} = 0$ mV) or inhibitory (i.e., $E_{\text{syn}} = E_{I} = -80$ mV) pressure/drive.
220
+
221
+
We will specifically model the excitatory and inhibitory conductance changes using exponential synapses and the input spike trains for each with Poisson encoding cells; in other words, two different groups of Poisson cells will be wired to a single LIF cell via exponential dynamic synapses. The code for doing this is as follows:
222
+
223
+
```python
224
+
from jax import numpy as jnp, random, jit
225
+
from ngcsimlib.context import Context
226
+
import numpy as np
227
+
np.random.seed(42)
228
+
from ngclearn.components import ExponentialSynapse, PoissonCell, LIFCell
229
+
from ngclearn.operations import summation
230
+
231
+
from ngcsimlib.compilers.process import Process
232
+
from ngcsimlib.context import Context
233
+
import ngclearn.utils.weight_distribution as dist
234
+
235
+
## create seeding keys
236
+
dkey = random.PRNGKey(1234)
237
+
dkey, *subkeys = random.split(dkey, 6)
238
+
239
+
## simulation properties
240
+
dt =0.1# ms
241
+
T =1000. # ms ## total duration time
242
+
243
+
## post-syn LIF cell properties
244
+
tau_m =10.
245
+
g_L =10.
246
+
v_rest =-75.
247
+
v_thr =-55.
248
+
249
+
## excitatory group properties
250
+
exc_freq =10. # Hz
251
+
n_exc =80
252
+
g_e_bar =2.4
253
+
tau_syn_exc =2.
254
+
E_rest_exc =0.
255
+
256
+
## inhibitory group properties
257
+
inh_freq =10. # Hz
258
+
n_inh =20
259
+
g_i_bar =2.4
260
+
tau_syn_inh =5.
261
+
E_rest_inh =-80.
262
+
263
+
Tsteps =int(T/dt)
264
+
265
+
## ---- build a simple E-I spiking circuit ----
266
+
with Context("ei_snn") as ctx:
267
+
pre_exc = PoissonCell("pre_exc", n_units=n_exc, target_freq=exc_freq, key=subkeys[0]) ## pre-syn excitatory group
268
+
pre_inh = PoissonCell("pre_inh", n_units=n_inh, target_freq=inh_freq, key=subkeys[1]) ## pre-syn inhibitory group
269
+
Wexc = ExponentialSynapse( ## dynamic synapse between excitatory group and LIF
### Examining the Simple Spiking Circuit's Behavior
307
+
308
+
To run the above spiking circuit, we then write the next block of code (making sure to track/store the resulting membrane potential and pulse values emitted by the post-synaptic LIF):
309
+
310
+
```python
311
+
volts = []
312
+
time_span = []
313
+
spikes = []
314
+
315
+
ctx.reset()
316
+
pre_exc.inputs.set(jnp.ones((1, n_exc)))
317
+
pre_inh.inputs.set(jnp.ones((1, n_inh)))
318
+
post_exc.v.set(post_exc.v.value *0-65.) ## initial condition for LIF is -65 mV
from which we may then write the following plotting code to visualize the post-synaptic LIF unit's membrane potential time-course along with any spikes it might have produced in response to the pre-synaptic spike trains:
0 commit comments