Created
October 31, 2017 15:35
-
-
Save cafielo/862c49a9d50b441fd04d8c08c8286d54 to your computer and use it in GitHub Desktop.
3. build a network
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model = Sequential() | |
model.add(Conv2D(32, (3, 3), input_shape=(28,28,1))) | |
model.add(Activation('relu')) | |
BatchNormalization(axis=-1) | |
model.add(Conv2D(32, (3, 3))) | |
model.add(Activation('relu')) | |
model.add(MaxPooling2D(pool_size=(2,2))) | |
BatchNormalization(axis=-1) | |
model.add(Conv2D(64,(3, 3))) | |
model.add(Activation('relu')) | |
BatchNormalization(axis=-1) | |
model.add(Conv2D(64, (3, 3))) | |
model.add(Activation('relu')) | |
model.add(MaxPooling2D(pool_size=(2,2))) | |
model.add(Flatten()) | |
# Fully connected layer | |
BatchNormalization() | |
model.add(Dense(512)) | |
model.add(Activation('relu')) | |
BatchNormalization() | |
model.add(Dropout(0.2)) | |
model.add(Dense(10)) | |
model.add(Activation('softmax')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment