Overview
Slax is a JAX library built on top of Flax. It provides learning rules and gradient approximations with a focus on training spiking neural networks; the README notes that some of these algorithms also apply to any recurrent network.
As of 2026-10-31, the README states that Slax “is now being rewritten with the NNX API” and that “Functionality and documentation is limited and unreliable until the conversion is finished.”
In the repository source
- Learning-rule modules named
OTTT,OTPE,rtrl,diag_rtrlandFPTT. - Training wrappers named
train_onlineandtrain_offline. - A leaky integrate-and-fire (
LIF) neuron and surrogate derivative functions (fast sigmoid, arctangent, multi-Gaussian). to_nirandfrom_nirfunctions for converting models to and from NIR. Import handles NIR affine, linear and LIF nodes.
Getting started
The README describes the PyPI package as “an alpha-state release with linen” (pip install slax). PyPI lists only version 0.0.1, uploaded on 2024-03-20. It is the earlier Linen-based version and differs from the repository: it provides DenseOSTL, DenseOTPE, OTTT, RTRL and FPTT, but not diag_rtrl or the NIR conversion functions.
Reference
T. M. Summe and S. Joshi, “Slax: a composable JAX library for rapid and flexible prototyping of spiking neural networks”, Neuromorphic Computing and Engineering 5, 014007 (2025), doi:10.1088/2634-4386/ada9a8.
