Learning the digits
You're going to build a model on the digits dataset, a sample dataset that comes pre-loaded with scikit learn. The digits dataset consist of 8x8 pixel handwritten digits from 0 to 9:
 
The dataset has already been partitioned into X_train, y_train, X_test, and y_test, using 30% of the data as testing data. The labels are already one-hot encoded vectors, so you don't need to use Keras to_categorical() function. 
Let's build this new model!
Diese Übung ist Teil des Kurses
Introduction to Deep Learning with Keras
Anleitung zur Übung
- Add a 
Denselayer of 16 neurons withreluactivation and aninput_shapethat takes the total number of pixels of the 8x8 digit image. - Add a 
Denselayer with 10 outputs andsoftmaxactivation. - Compile your model with 
adam,categorical_crossentropy, andaccuracymetrics. - Make sure your model works by predicting on 
X_train. 
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Instantiate a Sequential model
model = Sequential()
# Input and hidden layer with input_shape, 16 neurons, and relu 
model.add(Dense(____, input_shape = (____,), activation = ____))
# Output layer with 10 neurons (one per digit) and softmax
model.____(____)
# Compile your model
model.____(optimizer = ____, loss = ____, metrics = [____])
# Test if your model is well assembled by predicting before training
print(model.predict(____))