Complete the code to import Keras from TensorFlow.
from tensorflow import [1]
Keras is a high-level API in TensorFlow used for building and training models easily.
Complete the code to create a simple sequential model in Keras.
model = keras.models.[1]()The Sequential class in Keras allows you to build models layer by layer simply.
Fix the error in adding 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, not a string or keyword argument inside the first parameter.
Fill both blanks to compile the model with Adam optimizer and categorical crossentropy loss.
model.compile(optimizer=[1], loss=[2], metrics=['accuracy'])
Adam optimizer is popular for training, and categorical crossentropy is used for multi-class classification.
Fill all three blanks to train the model on data X_train and y_train for 5 epochs with batch size 32.
model.fit([1], [2], epochs=[3], batch_size=32)
To train a model, pass the input data, labels, and specify epochs. Batch size controls how many samples per update.