This is a feature release that introduces new neuron and synapse models in the state-based API (brainpy.state) and enhances the Dynamics base class with improved input handling.
Major Changes
New Neuron Models (brainpy.state)
-
LIF (Leaky Integrate-and-Fire) Variants: Added comprehensive set of LIF neuron models
LIF: Basic LIF neuron with exponential synaptic inputLifRef: LIF with refractory periodExpIF: Exponential Integrate-and-Fire neuronExpIFRef: ExpIF with refractory periodAdExIF: Adaptive Exponential Integrate-and-Fire neuronAdExIFRef: AdExIF with refractory periodQuaIF: Quadratic Integrate-and-Fire neuronQuaIFRef: QuaIF with refractory periodAdQuaIF: Adaptive Quadratic Integrate-and-Fire neuronAdQuaIFRef: AdQuaIF with refractory periodGifRef: Generalized Integrate-and-Fire with refractory period
-
Izhikevich Neuron Models: Added new Izhikevich neuron implementations
Izhikevich: Basic Izhikevich neuron modelIzhikevichRef: Izhikevich with refractory period
-
Hodgkin-Huxley Model: Added classic biophysical neuron model
HH: Classic Hodgkin-Huxley model with Na+ and K+ channels
New Synapse Models (brainpy.state)
- 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
Features
Model Implementation
- All new models use the brainstate ecosystem (HiddenState, ShortTermState, LongTermState)
- Proper unit support with brainunit integration
- Exponential Euler integration for numerical stability
- Batch processing support across all models
- Consistent API design following BrainPy v2.7+ architecture
Dynamics Class Enhancements
- Enhanced input handling capabilities in the Dynamics base class
- Added new properties for better state management
- Improved integration with brainstate framework
- Refactored to use public methods instead of private counterparts for clarity
Documentation
- Added comprehensive Examples sections to all neuron classes in
_lif.py - Each example includes:
- Import statements for required modules
- Basic usage with parameter specifications
- State initialization examples
- Update and spike generation examples
- Network integration with
brainstate.nn.Sequential - Notes highlighting key features
- All 13 neuron classes in
_lif.pynow have complete documentation - Simplified documentation paths by removing 'core-concepts' and 'quickstart' prefixes in index.rst
Bug Fixes
- Fixed import paths in
_base.py: changed references from brainstate to brainpy for consistency (057b872) - Fixed test suite issues (95ec203)
- Fixed test suite for proper unit handling in synapse models
Code Quality
- Refactored module assignments to
brainpy.statefor consistency across files (06b2bf4) - Refactored method calls in
_base.py: replaced private methods with public counterparts (210426a)
Testing
- Added comprehensive test suites for all new neuron models
- Added AMPA and GABAa synapse tests
- Added tests for Izhikevich neuron variants
- Added tests for Hodgkin-Huxley model
- All tests passing with proper unit handling
Files Modified
brainpy/__init__.py: Updated version to 2.7.1brainpy/state/_base.py: Enhanced Dynamics class with improved input handling (447 lines added)brainpy/state/_lif.py: Added extensive LIF neuron variants (1862 lines total)brainpy/state/_izhikevich.py: New file with Izhikevich models (407 lines)brainpy/state/_hh.py: New file with Hodgkin-Huxley model (666 lines)brainpy/state/_synapse.py: Added BioNMDA model (158 lines)brainpy/state/_projection.py: Updated for consistency (43 lines modified)brainpy/state/__init__.py: Updated exports for new models- Test files added:
_lif_test.py,_izhikevich_test.py,_hh_test.py,_synapse_test.py,_base_test.py - Documentation updates in
docs_state/index.rst
Removed
- Removed outdated documentation notebooks from
docs_state/:checkpointing-en.ipynbandcheckpointing-zh.ipynbsnn_simulation-en.ipynbandsnn_simulation-zh.ipynbsnn_training-en.ipynbandsnn_training-zh.ipynb
Notes
- This release significantly expands the
brainpy.statemodule with biologically realistic neuron and synapse models - All new models are fully compatible with the brainstate ecosystem
- Enhanced documentation provides clear usage examples for all models
- The Dynamics class refactoring improves the foundation for future state-based model development
What's Changed
- Update version to 2.7.1 and refactor Dynamics class: enhance input ha… by @chaoming0625 in #793
- update state neuron and synapse by @932179209 in #794
New Contributors
- @932179209 made their first contribution in #794
Full Changelog: V2.7.0...V2.7.1