A recurrent stochastic binary network