Recall & Review
beginner
What is a feature extraction strategy in machine learning?
It is a method to transform raw data into useful information (features) that a model can learn from more easily.
Click to reveal answer
intermediate
Why do we freeze layers in a pretrained model during feature extraction?
Freezing layers means we do not update their weights during training. This keeps the learned features intact and reduces training time.
Click to reveal answer
beginner
In PyTorch, how do you freeze the parameters of a pretrained model?
You set each parameter's requires_grad attribute to False, like: <br>
for param in model.parameters():<br> param.requires_grad = FalseClick to reveal answer
intermediate
What is the difference between feature extraction and fine-tuning?
Feature extraction uses pretrained model layers as fixed feature detectors. Fine-tuning updates some or all pretrained layers to better fit new data.
Click to reveal answer
intermediate
How can you replace the final layer of a pretrained model in PyTorch for feature extraction?
You assign a new layer to the model's classifier or fc attribute, for example:<br>
model.fc = nn.Linear(in_features, num_classes)Click to reveal answer
What does freezing layers in a pretrained model do?
✗ Incorrect
Freezing layers means their weights stay fixed and do not change during training.
Which PyTorch attribute controls if a parameter is trainable?
✗ Incorrect
The requires_grad attribute tells PyTorch whether to compute gradients for that parameter.
What is the main goal of feature extraction?
✗ Incorrect
Feature extraction leverages existing learned features to improve learning on new tasks.
When replacing the final layer in a pretrained model, what must you adjust?
✗ Incorrect
The final layer's output size must match the number of classes in your new task.
Which of these is NOT a benefit of feature extraction?
✗ Incorrect
Feature extraction helps but does not guarantee perfect accuracy.
Explain how to perform feature extraction using a pretrained model in PyTorch.
Think about which parts of the model you keep fixed and which parts you change.
You got /4 concepts.
Describe the difference between feature extraction and fine-tuning in transfer learning.
Consider how much of the pretrained model you allow to learn.
You got /4 concepts.