Release Date: July 9, 2026
Version 2.8.1 is a patch release that continues the 2.8.0 correctness focus. Its centerpiece is a second audited, library-wide bug-fix sweep (#868) — 18 confirmed defects across dnn, the integrators, encoders, initializers, connectivity, optimizers, dynold synaptic plasticity, the offline/online training algorithms, the object-transform layer, and the simulation runners — each backed by a co-located regression test. The release also repairs adaptive pooling on up-sampling, fixes a PoissonGroup spiking regression, and moves version metadata into a dedicated brainpy._version module.
Bug Fixes
Audited correctness sweep (#868)
Normalization and encoding
LayerNorm: normalize over the trailingnormalized_shapedimensions instead of the leading batch/time axes.WeightedPhaseEncoder: use a float power base so phase weights are non-zero (the encoder previously never spiked).
Integrators
- Stratonovich Euler–Heun SDE: scale the predictor's Wiener increment by
sqrt(dt), making it consistent with the corrector.
Initializers
TruncatedNormal: default to a finite 2-sigma truncation and acceptNonebounds as ±inf.DOGDecay: produce a symmetric kernel on non-square grids and honor thenormalizeflag._compute_fans: handle 0-D/1-D shapes, fixing VarianceScaling initializers on bias vectors.
Connectivity
FixedProb.build_csr: emit a valid full-range CSRindptrwhenpre_ratio < 1.FixedTotalNum: accept a fractionalnumas a connection fraction.GridConn: de-duplicate periodic-boundary COO edges on small grids.
Optimizers
MomentumNesterov: apply the Nesterov look-ahead (it was previously identical to plain Momentum).Adadelta: honor the learning rate.LARS: clamp the degenerate zero-norm trust ratio to 1.
Training algorithms and runners
Ridge/LinearRegression: fix an IRLSwhile_loopseed that returned the untrained initial weights.LogisticRegression: build the Newton diagonal with pure JAX ops, avoiding the__jax_array__abstractification error.OnlineTrainer: stop crashing on scalar monitor histories and keep time-major output indata_first_axis='T'mode.BPTT.fit: accept a valid iterable dataset of exactly two(x, y)batches.DSRunner.predict: forwardshared_argsin the memory-efficient path.
Object transforms
vector_grad: support the parameterized-decorator form (func=None).
Synaptic plasticity
dynoldshort-term plasticity (both implementations): remove a spurious source term so facilitation decays correctly when there are no presynaptic spikes.
Other fixes
dnnpooling: fix an adaptive-poolingZeroDivisionErrorwhen a spatial dimension is smaller than its target (up-sampling), and add numpy typing stubs (#867).dyn:PoissonGroupnow spikes correctly (booleanrand_likedtype regression) (#862).- Fixed a
SupportSTDP.stdp_updatekeyword typo and aDSRunnerdeprecation warning (#864). - Refreshed documentation notebooks and fixed
clear_buffer/pmapruntime bugs (#863).
Build and Tooling
- Drove package-wide
mypyto zero errors (#863). - Moved
__version__/__version_info__into a dedicatedbrainpy._versionmodule (#865) and read the packaged version statically at build time (#866). - Bumped
codecov/codecov-actionfrom 5 to 7 (#861).
Full Changelog: V2.8.0...V2.8.1