<s> import logging , os <EOL> logging . basicConfig ( level = logging . INFO ) <EOL> from deepy . dataset import MnistDataset , MiniBatches <EOL> from deepy . networks import NeuralClassifier <EOL> from deepy . layers import Dense , Softmax , Dropout , PRelu <EOL> from deepy . trainers import MomentumTrainer , LearningRateAnnealer <EOL> default_model = os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT>" , "<STR_LIT>" ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> model = NeuralClassifier ( input_dim = <NUM_LIT> * <NUM_LIT> ) <EOL> model . stack ( Dense ( <NUM_LIT> , '<STR_LIT>' ) , <EOL> PRelu ( ) , <EOL> Dropout ( <NUM_LIT> ) , <EOL> Dense ( <NUM_LIT> , '<STR_LIT>' ) , <EOL> PRelu ( ) , <EOL> Dropout ( <NUM_LIT> ) , <EOL> Dense ( <NUM_LIT:10> , '<STR_LIT>' ) , <EOL> Softmax ( ) ) <EOL> trainer = MomentumTrainer ( model ) <EOL> annealer = LearningRateAnnealer ( trainer ) <EOL> mnist = MiniBatches ( MnistDataset ( ) , batch_size = <NUM_LIT:20> ) <EOL> trainer . run ( mnist , controllers = [ annealer ] ) <EOL> model . save_params ( default_model ) </s>
