A modular library of 39 spiking neuron models across 8 families, designed for neuromorphic edge computing research.
Each family explores a different axis of spike generation:
| Family | Axis | Models | Key Question | Biological anchor |
|---|---|---|---|---|
| H-LIF | Threshold mechanism | 13 | How to decide to spike? | SFA, hazard functions (Benda-Herz 2003) |
| MS-IF | Time-scale / signal component | 7 | What to listen to? | Layered auditory AC (Hildebrandt 2009) |
| Liquid | Input-dependent dynamics | 2 | How fast to adapt? | Attention-gated delay tuning (Kothari 2018) |
| I-LIF | Information content | 3 | When is spiking informative? | Predictive coding, free energy |
| F-LIF | Memory depth / stochastic process | 3 | How deep is temporal memory? | Power-law adaptation, Weber-Fechner |
| K-LIF | Optimal control | 3 | What action should the spike trigger? | Cerebellar forward models |
| W-LIF | Signal transform | 3 | Which transform does the neuron compute? | A1 STRFs (Shamma) |
| C-LIF | Cardiac biophysics | 5 | Which cardiac property drives the spike? | SA node pacemaker, HH kinetics |
All models share a common interface and are compatible with PyTorch autograd via surrogate gradients.
The library enforces heterogeneity along three axes that biological nervous systems span by 3+ orders of magnitude: membrane time constants (100 μs to 400 ms, covering barn owl ITD detection to human speech integration), adaptation time constants (layered 18-150 ms cutoffs; Hildebrandt, Benda, Hennig 2009), and threshold mechanisms (deterministic, stochastic, state-dependent, hazard-driven). Each family addresses one axis; models within a family are not redundant. Sampling per-neuron membrane and adaptation time constants log-uniformly across these decades, instead of fixing a single value, is the heterogeneity that improves accuracy and robustness on temporal tasks (Perez-Nieves et al. 2021, Nat Commun 12:5791). Whether mixing several neuron types in one population helps beyond matching a single well-suited type is a separate, capacity-dependent question.
pip install -e .import torch
from dikmen_neurons import NeuronRegistry
# List all available models
print(NeuronRegistry.list_all())
# Instantiate any model by name
neuron = NeuronRegistry.create("TH-LIF", size=128)
# Standard forward pass
batch, timesteps, features = 32, 100, 128
x = torch.randn(batch, timesteps, features)
spikes, state = neuron(x) # spikes: [B, T, N], state: dictLIF (root)
├── Baseline: Det-LIF, Stoch-LIF
├── Core Hazard: BH-LIF, TH-LIF
│ └── Liquid: L-TH-LIF, L-BH-LIF
├── Physics: DB-LIF, RT-LIF, Thermal-LIF, Spin-LIF, Piezo-LIF
├── Architecture: CH-LIF, MoE-LIF, Att-LIF, HyperNet-LIF
├── MS-IF (ISAC): Dual-τ, Chirp, Phase, CrossInhib, Doppler, STFT, Beam
├── I-LIF (information): Surprise-LIF, FE-LIF, MI-LIF
├── F-LIF (fractional): Fα-LIF, Lévy-LIF, Hawkes-LIF
├── K-LIF (control): PID-LIF, Kalman-LIF, MPC-LIF
├── W-LIF (transform): Gabor-LIF, Hilbert-LIF, Wavelet-LIF
└── C-LIF (cardiac): RaF-LIF, Refr-LIF, PM-LIF, QRS-LIF, HRV-LIF
# Run all families on a dataset
python benchmarks/run_benchmark.py --dataset SHD --families all
# Run specific family
python benchmarks/run_benchmark.py --dataset CWRU --families h_lif k_lif
# Quick smoke test (synthetic data)
python benchmarks/smoke_test.pySupported datasets: SHD, SSC, SeqMNIST, CWRU, MIT-BIH, PTB-XL, DIAT-µSAT, RDRD, DIAT-µRadHAR, LTO-Battery.
Every neuron model implements single_step; the temporal loop, state init, and metadata are inherited from BaseNeuron:
class BaseNeuron(nn.Module):
def __init__(self, size: int, beta: float = 0.95, threshold: float = 1.0): ...
def single_step(self, x_t, state) -> tuple[Tensor, dict]: ... # implemented by each model
def forward(self, x: Tensor, state: dict = None) -> tuple[Tensor, dict]: ...
def init_state(self, batch_size: int, device=None) -> dict: ...
@property
def learnable_param_count(self) -> int: ...
@property
def family(self) -> str: ...
@property
def description(self) -> str: ...If you use this software in academic work, you must cite it.
Click the "Cite this repository" button on GitHub, or use:
@software{dikmen2026neuronlib,
author = {Dikmen, İsmail Can},
title = {Dikmen Spiking Neuron Families: 39 Models for Neuromorphic Edge Computing},
year = {2026},
publisher = {İstinye University},
url = {https://github.com/DrCanD/dikmen-spiking-neurons},
version = {1.2.0},
doi = {10.5281/zenodo.20110833},
license = {Apache-2.0}
}If you use a specific neuron model (e.g., TH-LIF, L-TH-LIF), please also cite the corresponding paper where that model was introduced.
The models, coding, training methods, and mathematical foundations behind these neuron families are developed in two companion preprints:
- "Spiking Neural Networks: A Tutorial on Models, Coding, and Training," Preprints.org, 2026. doi:10.20944/preprints202605.0827.v1
- "Spiking Neural Networks: Mathematical Foundations," Preprints.org, 2026. doi:10.20944/preprints202605.1130.v1
Apache License 2.0. See LICENSE.
This license includes an explicit patent grant. Note that Section 6 does not grant trademark rights; the project name and marks are reserved. You are free to use, modify, and distribute this software, provided you retain all copyright, patent, and attribution notices and document any modifications you make.
İsmail Can Dikmen — Assistant Professor, Electrical and Electronics Engineering, İstinye University, Istanbul, Turkey.
- ORCID: 0000-0002-7747-7777
- Web: Google Scholar
- IEEE Senior Member