def _dropout_from_layer(rng, layer, p):
 srng = theano.tensor.shared_randomstreams.RandomStreams(rng.randint(999999))
 mask = srng.binomial(n=1, p=(1 - p), size=layer.shape)
 output = (layer * T.cast(mask, theano.config.floatX))
 return output

def _dropout_from_layer ( rng , layer , p ) : srng = theano . tensor . shared_randomstreams . RandomStreams ( rng . randint ( 999999 ) ) mask = srng . binomial ( n = 1 , p = ( 1 - p ) , size = layer . shape ) output = ( layer * T . cast ( mask , theano . config . floatX ) ) return output
p is the probablity of dropping a unit .