brainstate 0.1.0.post20250413__py2.py3-none-any.whl → 0.1.0.post20250422__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- brainstate/_compatible_import.py +73 -0
- brainstate/_state.py +5 -4
- brainstate/_state_test.py +2 -1
- brainstate/augment/_autograd_test.py +3 -2
- brainstate/augment/_eval_shape.py +2 -1
- brainstate/augment/_mapping.py +0 -1
- brainstate/augment/_mapping_test.py +1 -0
- brainstate/compile/_ad_checkpoint.py +2 -1
- brainstate/compile/_conditions.py +4 -2
- brainstate/compile/_conditions_test.py +2 -1
- brainstate/compile/_error_if.py +2 -1
- brainstate/compile/_error_if_test.py +2 -1
- brainstate/compile/_jit.py +3 -2
- brainstate/compile/_jit_test.py +2 -1
- brainstate/compile/_loop_collect_return.py +2 -2
- brainstate/compile/_loop_collect_return_test.py +2 -1
- brainstate/compile/_loop_no_collection.py +1 -1
- brainstate/compile/_make_jaxpr.py +10 -13
- brainstate/compile/_make_jaxpr_test.py +3 -6
- brainstate/compile/_progress_bar.py +2 -1
- brainstate/compile/_unvmap.py +1 -5
- brainstate/environ.py +4 -4
- brainstate/environ_test.py +2 -1
- brainstate/functional/_activations.py +2 -1
- brainstate/functional/_activations_test.py +1 -1
- brainstate/functional/_normalization.py +2 -1
- brainstate/functional/_others.py +2 -1
- brainstate/graph/_graph_operation.py +3 -2
- brainstate/graph/_graph_operation_test.py +4 -3
- brainstate/init/_base.py +2 -1
- brainstate/init/_generic.py +2 -1
- brainstate/nn/__init__.py +4 -0
- brainstate/nn/_collective_ops.py +1 -0
- brainstate/nn/_collective_ops_test.py +0 -4
- brainstate/nn/_common.py +0 -1
- brainstate/nn/_dyn_impl/__init__.py +0 -4
- brainstate/nn/_dyn_impl/_dynamics_neuron.py +431 -13
- brainstate/nn/_dyn_impl/_dynamics_neuron_test.py +2 -1
- brainstate/nn/_dyn_impl/_dynamics_synapse.py +405 -103
- brainstate/nn/_dyn_impl/_dynamics_synapse_test.py +2 -1
- brainstate/nn/_dyn_impl/_inputs.py +236 -29
- brainstate/nn/_dyn_impl/_rate_rnns.py +238 -82
- brainstate/nn/_dyn_impl/_rate_rnns_test.py +2 -1
- brainstate/nn/_dyn_impl/_readout.py +91 -8
- brainstate/nn/_dyn_impl/_readout_test.py +2 -1
- brainstate/nn/_dynamics/_dynamics_base.py +676 -96
- brainstate/nn/_dynamics/_dynamics_base_test.py +2 -1
- brainstate/nn/_dynamics/_projection_base.py +29 -30
- brainstate/nn/_dynamics/_state_delay.py +3 -3
- brainstate/nn/_dynamics/_synouts_test.py +2 -1
- brainstate/nn/_elementwise/_dropout.py +3 -2
- brainstate/nn/_elementwise/_dropout_test.py +2 -1
- brainstate/nn/_elementwise/_elementwise.py +2 -1
- brainstate/nn/{_dyn_impl/_projection_alignpost.py → _event/__init__.py} +8 -7
- brainstate/nn/_event/_fixedprob_mv.py +169 -0
- brainstate/nn/_event/_fixedprob_mv_test.py +115 -0
- brainstate/nn/_event/_linear_mv.py +85 -0
- brainstate/nn/_event/_linear_mv_test.py +121 -0
- brainstate/nn/_exp_euler.py +2 -1
- brainstate/nn/_exp_euler_test.py +2 -1
- brainstate/nn/_interaction/_conv.py +2 -1
- brainstate/nn/_interaction/_linear.py +2 -1
- brainstate/nn/_interaction/_linear_test.py +2 -1
- brainstate/nn/_interaction/_normalizations.py +2 -1
- brainstate/nn/_interaction/_poolings.py +4 -3
- brainstate/nn/_module_test.py +2 -1
- brainstate/nn/metrics.py +4 -3
- brainstate/optim/_lr_scheduler.py +2 -1
- brainstate/optim/_lr_scheduler_test.py +2 -1
- brainstate/optim/_optax_optimizer_test.py +2 -1
- brainstate/optim/_sgd_optimizer.py +3 -2
- brainstate/random/_rand_funs.py +2 -1
- brainstate/random/_rand_funs_test.py +3 -2
- brainstate/random/_rand_seed.py +3 -2
- brainstate/random/_rand_seed_test.py +2 -1
- brainstate/random/_rand_state.py +4 -3
- brainstate/surrogate.py +1 -5
- brainstate/typing.py +4 -4
- brainstate/util/_caller.py +2 -1
- brainstate/util/_others.py +4 -4
- brainstate/util/_pretty_pytree.py +1 -1
- brainstate/util/_pretty_pytree_test.py +2 -1
- brainstate/util/_pretty_table.py +43 -43
- brainstate/util/_struct.py +2 -1
- brainstate/util/filter.py +0 -1
- {brainstate-0.1.0.post20250413.dist-info → brainstate-0.1.0.post20250422.dist-info}/METADATA +3 -3
- brainstate-0.1.0.post20250422.dist-info/RECORD +133 -0
- brainstate-0.1.0.post20250413.dist-info/RECORD +0 -128
- {brainstate-0.1.0.post20250413.dist-info → brainstate-0.1.0.post20250422.dist-info}/LICENSE +0 -0
- {brainstate-0.1.0.post20250413.dist-info → brainstate-0.1.0.post20250422.dist-info}/WHEEL +0 -0
- {brainstate-0.1.0.post20250413.dist-info → brainstate-0.1.0.post20250422.dist-info}/top_level.txt +0 -0
@@ -36,6 +36,25 @@ __all__ = [
|
|
36
36
|
class Synapse(Dynamics):
|
37
37
|
"""
|
38
38
|
Base class for synapse dynamics.
|
39
|
+
|
40
|
+
This class serves as the foundation for all synapse models in the library,
|
41
|
+
providing a common interface for implementing various types of synaptic
|
42
|
+
connectivity and transmission mechanisms.
|
43
|
+
|
44
|
+
Synapses are responsible for modeling the transmission of signals between
|
45
|
+
neurons, including temporal dynamics, plasticity, and neurotransmitter effects.
|
46
|
+
All specific synapse implementations (like Expon, Alpha, AMPA, etc.) should
|
47
|
+
inherit from this class.
|
48
|
+
|
49
|
+
See Also
|
50
|
+
--------
|
51
|
+
Expon : Simple first-order exponential decay synapse model
|
52
|
+
Alpha : Alpha function synapse model
|
53
|
+
DualExpon : Dual exponential synapse model
|
54
|
+
STP : Synapse with short-term plasticity
|
55
|
+
STD : Synapse with short-term depression
|
56
|
+
AMPA : AMPA receptor synapse model
|
57
|
+
GABAa : GABAa receptor synapse model
|
39
58
|
"""
|
40
59
|
__module__ = 'brainstate.nn'
|
41
60
|
|
@@ -44,9 +63,41 @@ class Expon(Synapse, AlignPost):
|
|
44
63
|
r"""
|
45
64
|
Exponential decay synapse model.
|
46
65
|
|
47
|
-
|
48
|
-
|
49
|
-
|
66
|
+
This class implements a simple first-order exponential decay synapse model where
|
67
|
+
the synaptic conductance g decays exponentially with time constant tau:
|
68
|
+
|
69
|
+
$$
|
70
|
+
dg/dt = -g/\tau + \text{input}
|
71
|
+
$$
|
72
|
+
|
73
|
+
The model is widely used for basic synaptic transmission modeling.
|
74
|
+
|
75
|
+
Parameters
|
76
|
+
----------
|
77
|
+
in_size : Size
|
78
|
+
Size of the input.
|
79
|
+
name : str, optional
|
80
|
+
Name of the synapse instance.
|
81
|
+
tau : ArrayLike, default=8.0*u.ms
|
82
|
+
Time constant of decay in milliseconds.
|
83
|
+
g_initializer : ArrayLike or Callable, default=init.ZeroInit(unit=u.mS)
|
84
|
+
Initial value or initializer for synaptic conductance.
|
85
|
+
|
86
|
+
Attributes
|
87
|
+
----------
|
88
|
+
g : HiddenState
|
89
|
+
Synaptic conductance state variable.
|
90
|
+
tau : Parameter
|
91
|
+
Time constant of decay.
|
92
|
+
|
93
|
+
Notes
|
94
|
+
-----
|
95
|
+
The implementation uses an exponential Euler integration method.
|
96
|
+
The output of this synapse is the conductance value.
|
97
|
+
|
98
|
+
This class inherits from :py:class:`AlignPost`, which means it can be used in projection patterns
|
99
|
+
where synaptic variables are aligned with post-synaptic neurons, enabling event-driven
|
100
|
+
computation and more efficient handling of sparse connectivity patterns.
|
50
101
|
"""
|
51
102
|
__module__ = 'brainstate.nn'
|
52
103
|
|
@@ -77,6 +128,62 @@ class Expon(Synapse, AlignPost):
|
|
77
128
|
|
78
129
|
|
79
130
|
class DualExpon(Synapse, AlignPost):
|
131
|
+
r"""
|
132
|
+
Dual exponential synapse model.
|
133
|
+
|
134
|
+
This class implements a synapse model with separate rise and decay time constants,
|
135
|
+
which produces a more biologically realistic conductance waveform than a single
|
136
|
+
exponential model. The model is characterized by the differential equation system:
|
137
|
+
|
138
|
+
dg_rise/dt = -g_rise/tau_rise
|
139
|
+
dg_decay/dt = -g_decay/tau_decay
|
140
|
+
g = a * (g_decay - g_rise)
|
141
|
+
|
142
|
+
where $a$ is a normalization factor that ensures the peak conductance reaches
|
143
|
+
the desired amplitude.
|
144
|
+
|
145
|
+
Parameters
|
146
|
+
----------
|
147
|
+
in_size : Size
|
148
|
+
Size of the input.
|
149
|
+
name : str, optional
|
150
|
+
Name of the synapse instance.
|
151
|
+
tau_decay : ArrayLike, default=10.0*u.ms
|
152
|
+
Time constant of decay in milliseconds.
|
153
|
+
tau_rise : ArrayLike, default=1.0*u.ms
|
154
|
+
Time constant of rise in milliseconds.
|
155
|
+
A : ArrayLike, optional
|
156
|
+
Amplitude scaling factor. If None, a scaling factor is automatically
|
157
|
+
calculated to normalize the peak amplitude.
|
158
|
+
g_initializer : ArrayLike or Callable, default=init.ZeroInit(unit=u.mS)
|
159
|
+
Initial value or initializer for synaptic conductance.
|
160
|
+
|
161
|
+
Attributes
|
162
|
+
----------
|
163
|
+
g_rise : HiddenState
|
164
|
+
Rise component of synaptic conductance.
|
165
|
+
g_decay : HiddenState
|
166
|
+
Decay component of synaptic conductance.
|
167
|
+
tau_rise : Parameter
|
168
|
+
Time constant of rise phase.
|
169
|
+
tau_decay : Parameter
|
170
|
+
Time constant of decay phase.
|
171
|
+
a : Parameter
|
172
|
+
Normalization factor calculated from tau_rise, tau_decay, and A.
|
173
|
+
|
174
|
+
Notes
|
175
|
+
-----
|
176
|
+
The dual exponential model produces a conductance waveform that is more
|
177
|
+
physiologically realistic than a simple exponential decay, with a finite
|
178
|
+
rise time followed by a slower decay.
|
179
|
+
|
180
|
+
The implementation uses an exponential Euler integration method.
|
181
|
+
The output of this synapse is the normalized difference between decay and rise components.
|
182
|
+
|
183
|
+
This class inherits from :py:class:`AlignPost`, which means it can be used in projection patterns
|
184
|
+
where synaptic variables are aligned with post-synaptic neurons, enabling event-driven
|
185
|
+
computation and more efficient handling of sparse connectivity patterns.
|
186
|
+
"""
|
80
187
|
__module__ = 'brainstate.nn'
|
81
188
|
|
82
189
|
def __init__(
|
@@ -127,6 +234,45 @@ class DualExpon(Synapse, AlignPost):
|
|
127
234
|
|
128
235
|
|
129
236
|
class Alpha(Synapse):
|
237
|
+
r"""
|
238
|
+
Alpha synapse model.
|
239
|
+
|
240
|
+
This class implements the alpha function synapse model, which produces
|
241
|
+
a smooth, biologically realistic synaptic conductance waveform.
|
242
|
+
The model is characterized by the differential equation system:
|
243
|
+
|
244
|
+
dh/dt = -h/tau
|
245
|
+
dg/dt = -g/tau + h/tau
|
246
|
+
|
247
|
+
This produces a response that rises and then falls with a characteristic
|
248
|
+
time constant $\tau$, with peak amplitude occurring at time $t = \tau$.
|
249
|
+
|
250
|
+
Parameters
|
251
|
+
----------
|
252
|
+
in_size : Size
|
253
|
+
Size of the input.
|
254
|
+
name : str, optional
|
255
|
+
Name of the synapse instance.
|
256
|
+
tau : ArrayLike, default=8.0*u.ms
|
257
|
+
Time constant of the alpha function in milliseconds.
|
258
|
+
g_initializer : ArrayLike or Callable, default=init.ZeroInit(unit=u.mS)
|
259
|
+
Initial value or initializer for synaptic conductance.
|
260
|
+
|
261
|
+
Attributes
|
262
|
+
----------
|
263
|
+
g : HiddenState
|
264
|
+
Synaptic conductance state variable.
|
265
|
+
h : HiddenState
|
266
|
+
Auxiliary state variable for implementing the alpha function.
|
267
|
+
tau : Parameter
|
268
|
+
Time constant of the alpha function.
|
269
|
+
|
270
|
+
Notes
|
271
|
+
-----
|
272
|
+
The alpha function is defined as g(t) = (t/tau) * exp(1-t/tau) for t ≥ 0.
|
273
|
+
This implementation uses an exponential Euler integration method.
|
274
|
+
The output of this synapse is the conductance value.
|
275
|
+
"""
|
130
276
|
__module__ = 'brainstate.nn'
|
131
277
|
|
132
278
|
def __init__(
|
@@ -160,15 +306,71 @@ class Alpha(Synapse):
|
|
160
306
|
|
161
307
|
|
162
308
|
class STP(Synapse):
|
163
|
-
r"""
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
309
|
+
r"""
|
310
|
+
Synapse with short-term plasticity.
|
311
|
+
|
312
|
+
This class implements a synapse model with short-term plasticity (STP), which captures
|
313
|
+
activity-dependent changes in synaptic efficacy that occur over milliseconds to seconds.
|
314
|
+
The model simultaneously accounts for both short-term facilitation and depression
|
315
|
+
based on the formulation by Tsodyks & Markram (1998).
|
316
|
+
|
317
|
+
The model is characterized by the following equations:
|
318
|
+
|
319
|
+
$$
|
320
|
+
\frac{du}{dt} = -\frac{u}{\tau_f} + U \cdot (1 - u) \cdot \delta(t - t_{spike})
|
321
|
+
$$
|
322
|
+
|
323
|
+
$$
|
324
|
+
\frac{dx}{dt} = \frac{1 - x}{\tau_d} - u \cdot x \cdot \delta(t - t_{spike})
|
325
|
+
$$
|
326
|
+
|
327
|
+
$$
|
328
|
+
g_{syn} = u \cdot x
|
329
|
+
$$
|
330
|
+
|
331
|
+
where:
|
332
|
+
- $u$ represents the utilization of synaptic efficacy (facilitation variable)
|
333
|
+
- $x$ represents the available synaptic resources (depression variable)
|
334
|
+
- $\tau_f$ is the facilitation time constant
|
335
|
+
- $\tau_d$ is the depression time constant
|
336
|
+
- $U$ is the baseline utilization parameter
|
337
|
+
- $\delta(t - t_{spike})$ is the Dirac delta function representing presynaptic spikes
|
338
|
+
- $g_{syn}$ is the effective synaptic conductance
|
339
|
+
|
340
|
+
Parameters
|
341
|
+
----------
|
342
|
+
in_size : Size
|
343
|
+
Size of the input.
|
344
|
+
name : str, optional
|
345
|
+
Name of the synapse instance.
|
346
|
+
U : ArrayLike, default=0.15
|
347
|
+
Baseline utilization parameter (fraction of resources used per action potential).
|
348
|
+
tau_f : ArrayLike, default=1500.*u.ms
|
349
|
+
Time constant of short-term facilitation in milliseconds.
|
350
|
+
tau_d : ArrayLike, default=200.*u.ms
|
351
|
+
Time constant of short-term depression (recovery of synaptic resources) in milliseconds.
|
352
|
+
|
353
|
+
Attributes
|
354
|
+
----------
|
355
|
+
u : HiddenState
|
356
|
+
Utilization of synaptic efficacy (facilitation variable).
|
357
|
+
x : HiddenState
|
358
|
+
Available synaptic resources (depression variable).
|
359
|
+
|
360
|
+
Notes
|
361
|
+
-----
|
362
|
+
- Larger values of tau_f produce stronger facilitation effects.
|
363
|
+
- Larger values of tau_d lead to slower recovery from depression.
|
364
|
+
- The parameter U controls the initial release probability.
|
365
|
+
- The effective synaptic strength is the product of u and x.
|
366
|
+
|
367
|
+
References
|
368
|
+
----------
|
369
|
+
.. [1] Tsodyks, M. V., & Markram, H. (1997). The neural code between neocortical
|
370
|
+
pyramidal neurons depends on neurotransmitter release probability.
|
371
|
+
Proceedings of the National Academy of Sciences, 94(2), 719-723.
|
372
|
+
.. [2] Tsodyks, M., Pawelzik, K., & Markram, H. (1998). Neural networks with dynamic
|
373
|
+
synapses. Neural computation, 10(4), 821-835.
|
172
374
|
"""
|
173
375
|
__module__ = 'brainstate.nn'
|
174
376
|
|
@@ -217,14 +419,59 @@ class STP(Synapse):
|
|
217
419
|
|
218
420
|
|
219
421
|
class STD(Synapse):
|
220
|
-
r"""
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
422
|
+
r"""
|
423
|
+
Synapse with short-term depression.
|
424
|
+
|
425
|
+
This class implements a synapse model with short-term depression (STD), which captures
|
426
|
+
activity-dependent reduction in synaptic efficacy, typically caused by depletion of
|
427
|
+
neurotransmitter vesicles following repeated stimulation.
|
428
|
+
|
429
|
+
The model is characterized by the following equation:
|
430
|
+
|
431
|
+
$$
|
432
|
+
\frac{dx}{dt} = \frac{1 - x}{\tau} - U \cdot x \cdot \delta(t - t_{spike})
|
433
|
+
$$
|
434
|
+
|
435
|
+
$$
|
436
|
+
g_{syn} = x
|
437
|
+
$$
|
438
|
+
|
439
|
+
where:
|
440
|
+
- $x$ represents the available synaptic resources (depression variable)
|
441
|
+
- $\tau$ is the depression recovery time constant
|
442
|
+
- $U$ is the utilization parameter (fraction of resources depleted per spike)
|
443
|
+
- $\delta(t - t_{spike})$ is the Dirac delta function representing presynaptic spikes
|
444
|
+
- $g_{syn}$ is the effective synaptic conductance
|
445
|
+
|
446
|
+
Parameters
|
447
|
+
----------
|
448
|
+
in_size : Size
|
449
|
+
Size of the input.
|
450
|
+
name : str, optional
|
451
|
+
Name of the synapse instance.
|
452
|
+
tau : ArrayLike, default=200.*u.ms
|
453
|
+
Time constant governing recovery of synaptic resources in milliseconds.
|
454
|
+
U : ArrayLike, default=0.07
|
455
|
+
Utilization parameter (fraction of resources used per action potential).
|
456
|
+
|
457
|
+
Attributes
|
458
|
+
----------
|
459
|
+
x : HiddenState
|
460
|
+
Available synaptic resources (depression variable).
|
461
|
+
|
462
|
+
Notes
|
463
|
+
-----
|
464
|
+
- Larger values of tau lead to slower recovery from depression.
|
465
|
+
- Larger values of U cause stronger depression with each spike.
|
466
|
+
- This model is a simplified version of the STP model that only includes depression.
|
467
|
+
|
468
|
+
References
|
469
|
+
----------
|
470
|
+
.. [1] Abbott, L. F., Varela, J. A., Sen, K., & Nelson, S. B. (1997). Synaptic
|
471
|
+
depression and cortical gain control. Science, 275(5297), 220-224.
|
472
|
+
.. [2] Tsodyks, M. V., & Markram, H. (1997). The neural code between neocortical
|
473
|
+
pyramidal neurons depends on neurotransmitter release probability.
|
474
|
+
Proceedings of the National Academy of Sciences, 94(2), 719-723.
|
228
475
|
"""
|
229
476
|
__module__ = 'brainstate.nn'
|
230
477
|
|
@@ -261,57 +508,76 @@ class STD(Synapse):
|
|
261
508
|
|
262
509
|
|
263
510
|
class AMPA(Synapse):
|
264
|
-
r"""AMPA synapse model.
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
511
|
+
r"""AMPA receptor synapse model.
|
512
|
+
|
513
|
+
This class implements a kinetic model of AMPA (α-amino-3-hydroxy-5-methyl-4-isoxazolepropionic acid)
|
514
|
+
receptor-mediated synaptic transmission. AMPA receptors are ionotropic glutamate receptors that mediate
|
515
|
+
fast excitatory synaptic transmission in the central nervous system.
|
516
|
+
|
517
|
+
The model uses a Markov process approach to describe the state transitions of AMPA receptors
|
518
|
+
between closed and open states, governed by neurotransmitter binding:
|
519
|
+
|
520
|
+
$$
|
521
|
+
\frac{dg}{dt} = \alpha [T] (1-g) - \beta g
|
522
|
+
$$
|
523
|
+
|
524
|
+
$$
|
525
|
+
I_{syn} = g_{max} \cdot g \cdot (V - E)
|
526
|
+
$$
|
527
|
+
|
528
|
+
where:
|
529
|
+
- $g$ represents the fraction of receptors in the open state
|
530
|
+
- $\alpha$ is the binding rate constant [ms^-1 mM^-1]
|
531
|
+
- $\beta$ is the unbinding rate constant [ms^-1]
|
532
|
+
- $[T]$ is the neurotransmitter concentration [mM]
|
533
|
+
- $I_{syn}$ is the resulting synaptic current
|
534
|
+
- $g_{max}$ is the maximum conductance
|
535
|
+
- $V$ is the membrane potential
|
536
|
+
- $E$ is the reversal potential
|
537
|
+
|
538
|
+
The neurotransmitter concentration $[T]$ follows a square pulse of amplitude T and
|
539
|
+
duration T_dur after each presynaptic spike.
|
540
|
+
|
541
|
+
Parameters
|
542
|
+
----------
|
543
|
+
in_size : Size
|
544
|
+
Size of the input.
|
545
|
+
name : str, optional
|
546
|
+
Name of the synapse instance.
|
547
|
+
alpha : ArrayLike, default=0.98/(u.ms*u.mM)
|
548
|
+
Binding rate constant [ms^-1 mM^-1].
|
549
|
+
beta : ArrayLike, default=0.18/u.ms
|
550
|
+
Unbinding rate constant [ms^-1].
|
551
|
+
T : ArrayLike, default=0.5*u.mM
|
552
|
+
Peak neurotransmitter concentration when released [mM].
|
553
|
+
T_dur : ArrayLike, default=0.5*u.ms
|
554
|
+
Duration of neurotransmitter presence in the synaptic cleft [ms].
|
555
|
+
g_initializer : ArrayLike or Callable, default=init.ZeroInit()
|
556
|
+
Initial value or initializer for the synaptic conductance.
|
557
|
+
|
558
|
+
Attributes
|
559
|
+
----------
|
560
|
+
g : HiddenState
|
561
|
+
Fraction of receptors in the open state.
|
562
|
+
spike_arrival_time : ShortTermState
|
563
|
+
Time of the most recent presynaptic spike.
|
564
|
+
|
565
|
+
Notes
|
566
|
+
-----
|
567
|
+
- The model captures the fast-rising and relatively fast-decaying excitatory currents
|
568
|
+
characteristic of AMPA receptor-mediated transmission.
|
569
|
+
- The time course of the synaptic conductance is determined by both the binding and
|
570
|
+
unbinding rate constants and the duration of transmitter presence.
|
571
|
+
- This implementation uses an exponential Euler integration method.
|
572
|
+
|
573
|
+
References
|
574
|
+
----------
|
575
|
+
.. [1] Destexhe, A., Mainen, Z. F., & Sejnowski, T. J. (1994). Synthesis of models for
|
576
|
+
excitable membranes, synaptic transmission and neuromodulation using a common
|
577
|
+
kinetic formalism. Journal of computational neuroscience, 1(3), 195-230.
|
578
|
+
.. [2] Vijayan, S., & Kopell, N. J. (2012). Thalamic model of awake alpha oscillations
|
579
|
+
and implications for stimulus processing. Proceedings of the National Academy
|
580
|
+
of Sciences, 109(45), 18553-18558.
|
315
581
|
"""
|
316
582
|
|
317
583
|
def __init__(
|
@@ -353,38 +619,74 @@ class AMPA(Synapse):
|
|
353
619
|
|
354
620
|
|
355
621
|
class GABAa(AMPA):
|
356
|
-
r"""GABAa synapse model.
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
622
|
+
r"""GABAa receptor synapse model.
|
623
|
+
|
624
|
+
This class implements a kinetic model of GABAa (gamma-aminobutyric acid type A)
|
625
|
+
receptor-mediated synaptic transmission. GABAa receptors are ionotropic chloride channels
|
626
|
+
that mediate fast inhibitory synaptic transmission in the central nervous system.
|
627
|
+
|
628
|
+
The model uses the same Markov process approach as the AMPA model but with different
|
629
|
+
kinetic parameters appropriate for GABAa receptors:
|
630
|
+
|
631
|
+
$$
|
632
|
+
\frac{dg}{dt} = \alpha [T] (1-g) - \beta g
|
633
|
+
$$
|
634
|
+
|
635
|
+
$$
|
636
|
+
I_{syn} = - g_{max} \cdot g \cdot (V - E)
|
637
|
+
$$
|
638
|
+
|
639
|
+
where:
|
640
|
+
- $g$ represents the fraction of receptors in the open state
|
641
|
+
- $\alpha$ is the binding rate constant [ms^-1 mM^-1], typically slower than AMPA
|
642
|
+
- $\beta$ is the unbinding rate constant [ms^-1]
|
643
|
+
- $[T]$ is the neurotransmitter (GABA) concentration [mM]
|
644
|
+
- $I_{syn}$ is the resulting synaptic current (note the negative sign indicating inhibition)
|
645
|
+
- $g_{max}$ is the maximum conductance
|
646
|
+
- $V$ is the membrane potential
|
647
|
+
- $E$ is the reversal potential (typically around -80 mV for chloride)
|
648
|
+
|
649
|
+
The neurotransmitter concentration $[T]$ follows a square pulse of amplitude T and
|
650
|
+
duration T_dur after each presynaptic spike.
|
651
|
+
|
652
|
+
Parameters
|
653
|
+
----------
|
654
|
+
in_size : Size
|
655
|
+
Size of the input.
|
656
|
+
name : str, optional
|
657
|
+
Name of the synapse instance.
|
658
|
+
alpha : ArrayLike, default=0.53/(u.ms*u.mM)
|
659
|
+
Binding rate constant [ms^-1 mM^-1]. Typically slower than AMPA receptors.
|
660
|
+
beta : ArrayLike, default=0.18/u.ms
|
661
|
+
Unbinding rate constant [ms^-1].
|
662
|
+
T : ArrayLike, default=1.0*u.mM
|
663
|
+
Peak neurotransmitter concentration when released [mM]. Higher than AMPA.
|
664
|
+
T_dur : ArrayLike, default=1.0*u.ms
|
665
|
+
Duration of neurotransmitter presence in the synaptic cleft [ms]. Longer than AMPA.
|
666
|
+
g_initializer : ArrayLike or Callable, default=init.ZeroInit()
|
667
|
+
Initial value or initializer for the synaptic conductance.
|
668
|
+
|
669
|
+
Attributes
|
670
|
+
----------
|
671
|
+
Inherits all attributes from AMPA class.
|
672
|
+
|
673
|
+
Notes
|
674
|
+
-----
|
675
|
+
- GABAa receptors typically produce slower-rising and longer-lasting currents compared to AMPA receptors.
|
676
|
+
- The inhibitory nature of GABAa receptors is reflected in the convention of using a negative sign in the
|
677
|
+
synaptic current equation.
|
678
|
+
- The reversal potential for GABAa receptors is typically around -80 mV (due to chloride), making them
|
679
|
+
inhibitory for neurons with resting potentials more positive than this value.
|
680
|
+
- This model does not include desensitization, which can be significant for prolonged GABA exposure.
|
681
|
+
|
682
|
+
References
|
683
|
+
----------
|
684
|
+
.. [1] Destexhe, A., Mainen, Z. F., & Sejnowski, T. J. (1994). Synthesis of models for
|
685
|
+
excitable membranes, synaptic transmission and neuromodulation using a common
|
686
|
+
kinetic formalism. Journal of computational neuroscience, 1(3), 195-230.
|
687
|
+
.. [2] Destexhe, A., & Paré, D. (1999). Impact of network activity on the integrative
|
688
|
+
properties of neocortical pyramidal neurons in vivo. Journal of neurophysiology,
|
689
|
+
81(4), 1531-1547.
|
388
690
|
"""
|
389
691
|
|
390
692
|
def __init__(
|