Tidied up stochastic weight update