https://paperswithcode.com/paper/lets-keep-it-simple-using-simple
基于MNIST with Keras for Beginners(.99457)
做的主要改动如下
model=Sequential()
model.add(Conv2D(filters=64, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal(), padding='same', input_shape=input_shape))
model.add(BatchNormalization())
model.add(keras.layers.Activation(keras.activations.relu))
#2
# model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal()))
# model.add(BatchNormalization())
# model.add(MaxPool2D(strides=(2,2)))
# model.add(Activation(keras.activations.relu))
# model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal()))
# model.add(BatchNormalization())
# model.add(MaxPool2D(strides=(2,2)))
# model.add(Activation(keras.activations.relu))
# model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal()))
# model.add(BatchNormalization())
# model.add(MaxPool2D(strides=(2,2)))
# model.add(Activation(keras.activations.relu))
#5
model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal(), padding='same'))
model.add(BatchNormalization())
model.add(Activation(keras.activations.relu))
model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal(), padding='same'))
model.add(BatchNormalization())
model.add(Activation(keras.activations.relu))
#7
model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal(), padding='same'))
model.add(BatchNormalization())
model.add(MaxPool2D(strides=(2,2)))
model.add(Activation(keras.activations.relu))
#8
model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal(), padding='same'))
model.add(BatchNormalization())
model.add(MaxPool2D(strides=(2,2)))
model.add(Activation(keras.activations.relu))
# model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal()))
# model.add(BatchNormalization())
# model.add(MaxPool2D(strides=(2,2)))
# model.add(Activation(keras.activations.relu))
#10
model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal(), padding='same'))
model.add(BatchNormalization())
model.add(Activation(keras.activations.relu))
#11
model.add(Conv2D(filters=128, kernel_size=(1,1), kernel_initializer=keras.initializers.glorot_normal(), padding='same'))
model.add(BatchNormalization())
model.add(Activation(keras.activations.relu))
#12
model.add(Conv2D(filters=128, kernel_size=(1,1), kernel_initializer=keras.initializers.glorot_normal(), padding='same'))
model.add(BatchNormalization())
model.add(MaxPool2D(strides=(2,2)))
model.add(Activation(keras.activations.relu))
#13
model.add(Conv2D(filters=128, kernel_size=(3,3), kernel_initializer=keras.initializers.glorot_normal(), padding='same'))
model.add(MaxPool2D(strides=(2,2)))
model.add(Activation(keras.activations.relu))
model.add(Flatten())
model.add(Dense(10, activation='softmax'))
model.compile(optimizer=keras.optimizers.Adam(), loss='categorical_crossentropy', metrics=['accuracy'])
submissions=pd.DataFrame({"ImageId": list(range(1,len(predicted_classes)+1)),
"Label": [np.argmax(predicted_classes[i]) for i in range(len(predicted_classes))]})
submissions.to_csv("asd.csv", index=False, header=True)