Skip to content
ml-recall

#requires-grad

1 question from Transfer Learning

Timed test

1 question · 1 min · score and explanations at the end

Take a test
Q 1 / 1Score 0 / 0

Question 1: Single choice

mediumAI-checkedTransfer Learning

Following d2l, you build finetune_net from a pretrained ResNet-18, replace its output layer, and then try to freeze the pretrained layers:

finetune_net = torchvision.models.resnet18(weights="IMAGENET1K_V1")
finetune_net.fc = nn.Linear(finetune_net.fc.in_features, 2)
for param in finetune_net.parameters():
    param.requires_grad = False

You meant to train only the new output layer. What happens when training starts?

Choose one option