0
0
TensorFlowml~20 mins

Why transfer learning saves time and data in TensorFlow - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Transfer Learning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why does transfer learning reduce training time?

Imagine you want to teach a model to recognize cats in photos. You start with a model already trained to recognize many objects. Why does this help reduce the time needed to train your cat-recognizing model?

ABecause the model already knows useful features like edges and shapes, so it needs less time to learn new tasks.
BBecause the model ignores previous knowledge and starts fresh, making training faster.
CBecause transfer learning uses a smaller dataset which automatically speeds up training.
DBecause transfer learning removes layers from the model, making it simpler and faster.
Attempts:
2 left
💡 Hint

Think about how learning to recognize letters helps you read new words faster.

🧠 Conceptual
intermediate
2:00remaining
How does transfer learning reduce the amount of data needed?

Why can transfer learning work well even if you have only a small dataset for your new task?

ABecause transfer learning creates synthetic data to increase dataset size automatically.
BBecause the model already learned general features from a large dataset, it needs fewer new examples to adapt.
CBecause transfer learning removes the need for data by using random weights.
DBecause transfer learning trains only the output layer, ignoring all other layers.
Attempts:
2 left
💡 Hint

Think about how knowing the alphabet helps you read new words without seeing many examples.

Predict Output
advanced
2:00remaining
Output of transfer learning model training metrics

Given this TensorFlow code snippet that uses transfer learning, what will be the shape of the output predictions?

TensorFlow
import tensorflow as tf
base_model = tf.keras.applications.MobileNetV2(input_shape=(96,96,3), include_top=False, weights='imagenet')
base_model.trainable = False
model = tf.keras.Sequential([
    base_model,
    tf.keras.layers.GlobalAveragePooling2D(),
    tf.keras.layers.Dense(5, activation='softmax')
])
import numpy as np
sample_input = np.random.rand(1,96,96,3).astype('float32')
predictions = model(sample_input)
print(predictions.shape)
A(1, 5)
B(96, 96, 3)
C(1, 1000)
D(5,)
Attempts:
2 left
💡 Hint

Look at the last Dense layer's output size and the batch size of the input.

Hyperparameter
advanced
2:00remaining
Choosing layers to train in transfer learning

You have a pretrained model and want to use transfer learning. Which approach best balances training time and adapting to a new task?

AFreeze all layers and train only the input layer.
BTrain all layers from scratch to fully adapt the model to the new data.
CFreeze most layers and train only the last few layers to adapt features to the new task.
DFreeze only the first layer and train all others.
Attempts:
2 left
💡 Hint

Think about keeping learned features but allowing some adaptation.

Metrics
expert
2:00remaining
Interpreting transfer learning training curves

You train a transfer learning model and see training accuracy quickly reaches 95%, but validation accuracy stays around 70%. What is the most likely explanation?

AThe learning rate is too low, preventing the model from learning.
BThe model is underfitting and needs more training epochs.
CThe pretrained weights are not loaded correctly, causing poor validation.
DThe model is overfitting the small new dataset and not generalizing well.
Attempts:
2 left
💡 Hint

Think about what it means when training is good but validation is poor.