Skip to content

Commit a45684d

Browse files
committed
Add state version implementations for neuron and synapse models
This commit implements state versions of several neuron and synapse models using the brainstate framework, following BrainPy v2.7+ architecture. Neuron Models Added: - LIF (Leaky Integrate-and-Fire) neurons with multiple variants: * LIF: Basic LIF neuron with exponential synaptic input * LifRef: LIF with refractory period * ExpIF: Exponential Integrate-and-Fire * ExpIFRef: ExpIF with refractory period * AdExIF: Adaptive Exponential Integrate-and-Fire * AdExIFRef: AdExIF with refractory period * QuaIF: Quadratic Integrate-and-Fire * QuaIFRef: QuaIF with refractory period * AdQuaIF: Adaptive Quadratic Integrate-and-Fire * AdQuaIFRef: AdQuaIF with refractory period * GifRef: Generalized Integrate-and-Fire with refractory - Izhikevich neuron model with variants: * Izhikevich: Basic Izhikevich neuron * IzhikevichRef: With refractory period - Hodgkin-Huxley (HH) neuron model: * HH: Classic Hodgkin-Huxley model with Na+ and K+ channels Synapse Models Added: - BioNMDA: Biological NMDA receptor with second-order kinetics * Implements two-state cascade dynamics (x and g variables) * Slower rise time compared to AMPA (biologically realistic) * Comprehensive documentation with mathematical formulation Testing: - Comprehensive test suites added for all models - AMPA and GABAa synapse tests added - All tests passing with proper unit handling Key Features: - Uses brainstate ecosystem (HiddenState, ShortTermState, LongTermState) - Proper unit support with brainunit - Exponential Euler integration for numerical stability - Batch processing support - Consistent API design across all models Files Modified: - brainpy/state/_lif.py: Added LIF variants - brainpy/state/_izhikevich.py: Added Izhikevich variants (new file) - brainpy/state/_hh.py: Added HH model (new file) - brainpy/state/_synapse.py: Added BioNMDA model - brainpy/state/_synapse_test.py: Added comprehensive tests - brainpy/state/_lif_test.py: Added LIF tests - brainpy/state/__init__.py: Updated exports - brainpy/dyn/neurons/lif.py: Minor documentation updates
1 parent 3448676 commit a45684d

10 files changed

Lines changed: 3924 additions & 203 deletions

File tree

brainpy/dyn/neurons/lif.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,10 @@ class ExpIF(ExpIFLTC):
857857
conductance-based synaptic drive." Physical Review E 76, no. 2 (2007): 021919.
858858
.. [5] https://en.wikipedia.org/wiki/Exponential_integrate-and-fire
859859
860+
.. seealso::
861+
862+
:class:`brainpy.state.ExpIF` provides the state-based formulation of this neuron.
863+
860864
**Examples**
861865
862866
There is a simple usage example::
@@ -978,6 +982,10 @@ class ExpIFRefLTC(ExpIFLTC):
978982
conductance-based synaptic drive." Physical Review E 76, no. 2 (2007): 021919.
979983
.. [5] https://en.wikipedia.org/wiki/Exponential_integrate-and-fire
980984
985+
.. seealso::
986+
987+
:class:`brainpy.state.ExpIFRef` provides the state-based formulation of this neuron.
988+
981989
**Examples**
982990
983991
There is a simple usage example::
@@ -1319,6 +1327,10 @@ class AdExIFLTC(GradNeuDyn):
13191327
inputs." Journal of Neuroscience 23.37 (2003): 11628-11640.
13201328
.. [2] http://www.scholarpedia.org/article/Adaptive_exponential_integrate-and-fire_model
13211329
1330+
.. seealso::
1331+
1332+
:class:`brainpy.state.AdExIF` provides the state-based formulation of this model.
1333+
13221334
**Examples**
13231335
13241336
An example usage:

brainpy/state/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
from ._inputs import __all__ as inputs_all
2323
from ._lif import *
2424
from ._lif import __all__ as neuron_all
25+
from ._izhikevich import *
26+
from ._izhikevich import __all__ as izh_all
27+
from ._hh import *
28+
from ._hh import __all__ as hh_all
2529
from ._projection import *
2630
from ._projection import __all__ as proj_all
2731
from ._readout import *
@@ -36,9 +40,9 @@
3640
from ._synouts import __all__ as synout_all
3741
from .. import mixin
3842

39-
__main__ = ['version2', 'mixin'] + inputs_all + neuron_all + readout_all + stp_all + synapse_all
43+
__main__ = ['version2', 'mixin'] + inputs_all + neuron_all + izh_all + hh_all + readout_all + stp_all + synapse_all
4044
__main__ = __main__ + synout_all + base_all + exp_all + proj_all + synproj_all
41-
del inputs_all, neuron_all, readout_all, stp_all, synapse_all, synout_all, base_all
45+
del inputs_all, neuron_all, izh_all, hh_all, readout_all, stp_all, synapse_all, synout_all, base_all
4246
del exp_all, proj_all, synproj_all
4347

4448
if __name__ == '__main__':

0 commit comments

Comments
 (0)