(28, activation="relu"
)函数的作用,mnist数据集在神经网络中的Dropout
和softmax
在整个代码中需要每一层的正确指导
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(input_shape=(28, 28)),
tf.keras.layers.Dense(128, activation='relu'),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(10, activation='softmax')
])