Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Spiking Neural Network library built natively on Apple MLX
| Date | Stars |
|---|---|
| 2026-07-31 | 510 |
| 2026-08-06 | 510 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# mlx-snn
**A general-purpose Spiking Neural Network library built on Apple [MLX](https://github.com/ml-explore/mlx).**
mlx-snn aims to provide an efficient, research-friendly SNN framework that leverages MLX's unified memory architecture and lazy evaluation. Whether you're exploring neuron dynamics, training classifiers with surrogate gradients, or exchanging models via [NIR](https://github.com/neuromorphs/NIR), mlx-snn offers a clean, Pythonic API that integrates naturally into the MLX ecosystem.
[](https://github.com/D-ST-Sword/mlx-snn/actions/workflows/ci.yml)
[](https://pypi.org/project/mlx-snn/)
[](https://python.org)
[](LICENSE)
[](https://d-st-sword.github.io/mlx-snn/)
[](https://arxiv.org/abs/2603.03529)
> **9 neuron models** · **6 surrogate gradients** · **8 spike encodings** · **5 neuromorphic datasets** · **LSM reservoir** · **NIR interop** · **403 tests**
## Highlights
<table>
<tr>
<td width="33%" valign="top">
**Unified Memory SNNs**
SNNs store per-neuron states across every timestep — a memory bottleneck on discrete-GPU architectures. Apple Silicon's unified memory eliminates CPU↔GPU transfers, enabling extended temporal windows and larger reservoirs without the VRAM wall.
</td>
<td width="33%" valign="top">
**17–25× Energy Efficiency**
M3 Max trains SNNs **2.6–3.7× faster** than Tesla V100 at 1/7th the power. Recurrent spiking dynamics are latency-bound, not compute-bound — favoring Apple Silicon's high-bandwidth unified architecture over datacenter parallelism.
</td>
<td width="33%" valign="top">
**Multi-Scale Temporal Modeling**
`MSLeaky` assigns frequency-matched decay rates to parallel spiking branches — capturing delta through gamma dynamics in a single network. Chunked BPTT with state detachment scales to long biosignal sequences (EEG, fMRI) without exploding memory.
</td>
</tr>
</table>
## Installation
```bash
pip install mlx-snn
```
Requires Python 3.9+ and Apple Silicon (M1/M2/M3/M4).
## Quick Start
```python
import mlx.core as mx
import mlx.nn as nn
import mlxsnn
# Build a spiking network
fc = nn.Linear(784, 10)
lif = mlxsnn.Leaky(beta=0.95, threshold=1.0)
# Encode input as spike train and run over time
spikes_in = mlxsnn.rate_encode(mx.random.uniform(shape=(8, 784)), num_steps=25)
state = lif.init_state(batch_size=8, features=10)
for t in range(25):
spk, state = lif(fc(spikes_in[t]), state)
print("Output membrane:", state["mem"].shape) # (8, 10)
```
## Features
### Neuron Models
All neurons support `learn_threshold` and configurable reset mechanisms (`subtract` / `zero` / `none`). Neurons with a decay constant support `learn_beta`; recurrent neurons support `learn_V`. State is always an explicit dict — compatible with MLX's functional transforms and `mx.compile`.
| Model | Description | State Variables |
|-------|-------------|-----------------|
| **Leaky (LIF)** | Leaky Integrate-and-Fire with configurable decay | `mem` |
| **IF** | Integrate-and-Fire (non-leaky, perfect integrator) | `mem` |
| **Izhikevich** | 2D dynamics with RS/IB/CH/FS presets | `v`, `u` |
| **ALIF** | Adaptive LIF with dynamic threshold | `mem`, `adapt` |
| **Synaptic** | Conductance-based dual-state LIF | `syn`, `mem` |
| **Alpha** | Dual-exponential synaptic model | `syn_exc`, `syn_inh`, `mem` |
| **RLeaky** | Recurrent LIF with learnable feedback | `mem`, `spk` |
| **RSynaptic** | Recurrent Synaptic with learnable feedback | `syn`, `mem`, `spk` |
| **MSLeaky** | Multi-scale LIF with per-branch frequency-matched `beta` | `mem` per branch |
### Surrogate Gradients
All neurons support differentiaExcerpt of 14,638 characters
Read on GitHub6
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:8f57acd3d74e5234, llm:Repository description: 'Spiking Neural Network library built natively on Apple MLX'
matched fp:8f57acd3d74e5234, llm:Repository description: 'Spiking Neural Network library built natively on Apple MLX'
matched fp:8f57acd3d74e5234, llm:Repository description: 'Spiking Neural Network library built natively on Apple MLX'