SMS dit: Learning recurrent dynamics in spiking networks