it's probably better just in terms of code cleanliness to use theano_rng.binomial instead of manually doing the thresholding here. But I don't think there's anything wrong with this.