Week 4 Quiz :Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning (DeepLearning.AI TensorFlow Developer Professional Certificate) Answers 2025
1. Question 1 — How to scale pixel values to 0–1?
-
❌ normalize parameter
-
❌ Normalization layer
-
✅ Rescaling layer (tf.keras.layers.Rescaling())
-
❌ TensorFlow does it automatically
-
❌ rescale parameter
Explanation:
Use:
tf.keras.layers.Rescaling(1./255)
2. Question 2 — How does image_dataset_from_directory assign labels?
-
✅ Based on the directory each image is contained in
-
❌ TensorFlow reads contents
-
❌ Based on filename
-
❌ Manual labeling required
Explanation:
Each folder name becomes a class label.
3. Question 3 — Effects of reducing image resolution
Correct answers (multiple):
-
✅ Training is faster
-
❌ You no longer need to rescale
-
❌ Training results may differ (TRUE but you missed it)
-
✅ You lose information
✔️ Correct choices: Training is faster + Training results may differ + Info loss
4. Question 4 — Meaning of input_shape = (300, 300, 3)
-
❌ 3 bytes
-
❌ 300 images
-
❌ 3 conv layers
-
✅ Each image is 300×300 with 3 color channels (RGB)
5. Question 5 — Training accuracy 1.000 but low validation
-
✅ You’re overfitting on your training data
-
❌ Overfitting validation
-
❌ Underfitting validation
-
❌ No risk
Explanation:
High train accuracy + low val accuracy = classic overfitting.
6. Question 6 — How to set target image resolution?
-
❌ target_size
-
❌ Rescaling
-
✅ image_size parameter
-
❌ training_size
Explanation:
image_size=(300,300)
🧾 Summary Table
| Q | Correct Answer |
|---|---|
| 1 | Rescaling layer |
| 2 | Based on directory names |
| 3 | Faster training + Different results + Info loss |
| 4 | 300×300×3 RGB images |
| 5 | Overfitting on training data |
| 6 | image_size parameter |