Complete the code to create an input layer with shape (28, 28).
inputs = tf.keras.Input(shape=[1])The Input layer requires the shape as a tuple. (28, 28) correctly specifies the input shape for images of 28 by 28 pixels.
Complete the code to add a Dense layer with 64 units and ReLU activation.
x = tf.keras.layers.Dense([1], activation='relu')(inputs)
The Dense layer should have 64 units as specified, with ReLU activation.
Fix the error in the code to create the model using the Functional API.
model = tf.keras.Model(inputs=[1], outputs=x)The inputs argument must be the input tensor, which is 'inputs' here, not 'x' or other variables.
Fill both blanks to flatten the input and add a Dense layer with 10 units.
x = tf.keras.layers.[1]()(inputs) x = tf.keras.layers.Dense([2])(x)
First, the Flatten layer converts the input to 1D. Then, a Dense layer with 10 units is added for output classes.
Fill all three blanks to compile the model with Adam optimizer, sparse categorical crossentropy loss, and accuracy metric.
model.compile(optimizer='[1]', loss='[2]', metrics=['[3]'])
Adam optimizer is popular for training. Sparse categorical crossentropy is used for integer labels in classification. Accuracy is a common metric to track.