<s> import DeepFried2 as df <EOL> from theano . sandbox . rng_mrg import MRG_RandomStreams <EOL> _srng = MRG_RandomStreams ( ) <EOL> class Dropout ( df . Module ) : <EOL> def __init__ ( self , dropout ) : <EOL> df . Module . __init__ ( self ) <EOL> self . dropout = dropout <EOL> def symb_forward ( self , symb_input ) : <EOL> if self . _mode == '<STR_LIT:train>' : <EOL> mask = _srng . binomial ( symb_input . shape , <EOL> p = ( <NUM_LIT:1.> - self . dropout ) , <EOL> dtype = df . floatX <EOL> ) <EOL> return symb_input / ( <NUM_LIT:1.> - self . dropout ) * mask <EOL> else : <EOL> return symb_input </s>
