<s> import DeepFried2 as df <EOL> def net ( ) : <EOL> model = df . Sequential ( ) <EOL> model . add ( df . Linear ( <NUM_LIT> * <NUM_LIT> , <NUM_LIT:100> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . Linear ( <NUM_LIT:100> , <NUM_LIT:100> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . Linear ( <NUM_LIT:100> , <NUM_LIT:100> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . Linear ( <NUM_LIT:100> , <NUM_LIT:10> ) ) <EOL> model . add ( df . SoftMax ( ) ) <EOL> return model <EOL> def lenet_cudnn ( ) : <EOL> model = df . Sequential ( ) <EOL> model . add ( df . Reshape ( - <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT> ) ) <EOL> model . add ( df . SpatialConvolutionCUDNN ( <NUM_LIT:1> , <NUM_LIT:32> , ( <NUM_LIT:5> , <NUM_LIT:5> ) , border = '<STR_LIT>' , bias = False ) ) <EOL> model . add ( df . BatchNormalization ( <NUM_LIT:32> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . SpatialMaxPoolingCUDNN ( ( <NUM_LIT:2> , <NUM_LIT:2> ) ) ) <EOL> model . add ( df . SpatialConvolutionCUDNN ( <NUM_LIT:32> , <NUM_LIT:64> , ( <NUM_LIT:5> , <NUM_LIT:5> ) , border = '<STR_LIT>' , bias = False ) ) <EOL> model . add ( df . BatchNormalization ( <NUM_LIT:64> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . SpatialMaxPoolingCUDNN ( ( <NUM_LIT:2> , <NUM_LIT:2> ) ) ) <EOL> model . add ( df . Reshape ( - <NUM_LIT:1> , <NUM_LIT:7> * <NUM_LIT:7> * <NUM_LIT:64> ) ) <EOL> model . add ( df . Linear ( <NUM_LIT:7> * <NUM_LIT:7> * <NUM_LIT:64> , <NUM_LIT:100> , bias = False ) ) <EOL> model . add ( df . BatchNormalization ( <NUM_LIT:100> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . Dropout ( <NUM_LIT:0.5> ) ) <EOL> model . add ( df . Linear ( <NUM_LIT:100> , <NUM_LIT:10> ) ) <EOL> model . add ( df . SoftMax ( ) ) <EOL> return model <EOL> def lenet_same ( ) : <EOL> model = df . Sequential ( ) <EOL> model . add ( df . Reshape ( - <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT> ) ) <EOL> model . add ( df . SpatialConvolution ( <NUM_LIT:1> , <NUM_LIT:32> , ( <NUM_LIT:5> , <NUM_LIT:5> ) , border = '<STR_LIT>' , bias = False ) ) <EOL> model . add ( df . BatchNormalization ( <NUM_LIT:32> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . SpatialMaxPooling ( ( <NUM_LIT:2> , <NUM_LIT:2> ) ) ) <EOL> model . add ( df . SpatialConvolution ( <NUM_LIT:32> , <NUM_LIT:64> , ( <NUM_LIT:5> , <NUM_LIT:5> ) , border = '<STR_LIT>' , bias = False ) ) <EOL> model . add ( df . BatchNormalization ( <NUM_LIT:64> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . SpatialMaxPooling ( ( <NUM_LIT:2> , <NUM_LIT:2> ) ) ) <EOL> model . add ( df . Reshape ( - <NUM_LIT:1> , <NUM_LIT:7> * <NUM_LIT:7> * <NUM_LIT:64> ) ) <EOL> model . add ( df . Linear ( <NUM_LIT:7> * <NUM_LIT:7> * <NUM_LIT:64> , <NUM_LIT:100> , bias = False ) ) <EOL> model . add ( df . BatchNormalization ( <NUM_LIT:100> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . Dropout ( <NUM_LIT:0.5> ) ) <EOL> model . add ( df . Linear ( <NUM_LIT:100> , <NUM_LIT:10> ) ) <EOL> model . add ( df . SoftMax ( ) ) <EOL> return model <EOL> def lenet ( ) : <EOL> model = df . Sequential ( ) <EOL> model . add ( df . Reshape ( - <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT> ) ) <EOL> model . add ( df . SpatialConvolution ( <NUM_LIT:1> , <NUM_LIT:32> , ( <NUM_LIT:5> , <NUM_LIT:5> ) , bias = False ) ) <EOL> model . add ( df . BatchNormalization ( <NUM_LIT:32> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . SpatialMaxPooling ( ( <NUM_LIT:2> , <NUM_LIT:2> ) ) ) <EOL> model . add ( df . SpatialConvolution ( <NUM_LIT:32> , <NUM_LIT:64> , ( <NUM_LIT:5> , <NUM_LIT:5> ) , bias = False ) ) <EOL> model . add ( df . BatchNormalization ( <NUM_LIT:64> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . SpatialMaxPooling ( ( <NUM_LIT:2> , <NUM_LIT:2> ) ) ) <EOL> model . add ( df . Reshape ( - <NUM_LIT:1> , <NUM_LIT:4> * <NUM_LIT:4> * <NUM_LIT:64> ) ) <EOL> model . add ( df . Linear ( <NUM_LIT:4> * <NUM_LIT:4> * <NUM_LIT:64> , <NUM_LIT:100> , bias = False ) ) <EOL> model . add ( df . BatchNormalization ( <NUM_LIT:100> ) ) <EOL> model . add ( df . ReLU ( ) ) <EOL> model . add ( df . Dropout ( <NUM_LIT:0.5> ) ) <EOL> model . add ( df . Linear ( <NUM_LIT:100> , <NUM_LIT:10> ) ) <EOL> model . add ( df . SoftMax ( ) ) <EOL> return model </s>
