Stable learning using spiking neural networks equipped with affine encoders and decoders (JMLR, 2026)