Complete the code to import Keras from TensorFlow.
from tensorflow import [1]
We import keras from TensorFlow to use its high-level API for building models.
Complete the code to create a Sequential model in Keras.
model = keras.models.[1]()The Sequential class is used to create a simple linear stack of layers in Keras.
Fix the error in the code to add a Dense layer with 10 units and ReLU activation.
model.add(keras.layers.Dense([1], activation='relu'))
The number of units must be an integer, so 10 without quotes is correct.
Fill both blanks to compile the model with Adam optimizer and categorical crossentropy loss.
model.compile(optimizer='[1]', loss='[2]', metrics=['accuracy'])
Adam is a popular optimizer and categorical_crossentropy is the correct loss for multi-class classification.
Fill all three blanks to train the model for 5 epochs with batch size 32 on data X_train and y_train.
model.fit([1], [2], epochs=[3], batch_size=32)
We train the model on input data X_train and labels y_train for 5 epochs.