Local learning algorithms for stochastic spiking neural networks