Exercise

Compiling a sequential model

In this exercise, you will work towards classifying letters from the Sign Language MNIST dataset; however, you will adopt a different network architecture than what you used in the previous exercise. There will be fewer layers, but more nodes. You will also apply dropout to prevent overfitting. Finally, you will compile the model to use the adam optimizer and the categorical_crossentropy loss. You will also use a method in keras to summarize your model's architecture. Note that keras has been imported from tensorflow for you and a sequential keras model has been defined as model.

Instructions

100 XP
  • In the first dense layer, set the number of nodes to 16, the activation to sigmoid, and the input_shape to (784,).
  • Apply dropout at a rate of 25% to the first layer's output.
  • Set the output layer to be dense, have 4 nodes, and use a softmax activation function.
  • Compile the model using an adam optimizer and categorical_crossentropy loss function.