Skip to content

Instantly share code, notes, and snippets.

@jvmncs
Created October 24, 2019 13:18
Show Gist options
  • Save jvmncs/ac9026427abf8ab81be7ae34b2ef588f to your computer and use it in GitHub Desktop.
Save jvmncs/ac9026427abf8ab81be7ae34b2ef588f to your computer and use it in GitHub Desktop.
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')
])
# Compile with optimizer, loss and metrics
model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment