Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to import the InceptionV3 model from Keras applications.
Computer Vision
from tensorflow.keras.applications import [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Importing a different model like ResNet50 or VGG16 instead of InceptionV3.
✗ Incorrect
The InceptionV3 model is imported from tensorflow.keras.applications using 'InceptionV3'.
2fill in blank
mediumComplete the code to create an InceptionV3 model without the top classification layer.
Computer Vision
model = InceptionV3(weights='imagenet', include_top=[1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting include_top=True which keeps the original classification layers.
✗ Incorrect
Setting include_top=False removes the final classification layers, allowing customization.
3fill in blank
hardFix the error in the code to add a global average pooling layer after the Inception base.
Computer Vision
from tensorflow.keras.layers import GlobalAveragePooling2D x = model.output x = [1](x)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Dense or Flatten which are not pooling layers.
Using GlobalMaxPooling2D which uses max instead of average.
✗ Incorrect
GlobalAveragePooling2D reduces each feature map to a single value by averaging, suitable after convolutional layers.
4fill in blank
hardFill both blanks to add a dense output layer with 10 classes and softmax activation.
Computer Vision
from tensorflow.keras.layers import Dense outputs = Dense([1], activation=[2])(x)
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using relu activation in the output layer.
Setting units to 1 instead of 10.
✗ Incorrect
The output layer has 10 units for 10 classes and uses softmax activation for probabilities.
5fill in blank
hardFill all three blanks to compile the model with Adam optimizer, categorical crossentropy loss, and accuracy metric.
Computer Vision
model.compile(optimizer=[1], loss=[2], metrics=[[3]])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'mse' loss which is for regression.
Using wrong metric like 'mse' instead of 'accuracy'.
✗ Incorrect
Adam optimizer is popular; categorical crossentropy is used for multi-class classification; accuracy measures correct predictions.