Freeze or fine-tune?
Choose a transfer-learning strategy for four real situations, then count exactly how many ResNet-50 parameters you'd be training.
Predict first
Commit to a guess before you touch anything. Being wrong here is how it sticks.
A linear probe on 2,048-d features for 10 classes (with bias). Trainable parameters?
Experiment
Move the controls and watch the outputs. Goals tick off automatically when you reach them.
Freeze or fine-tune?
model = resnet50(weights="IMAGENET1K_V2") for p in model.parameters(): p.requires_grad = False model.fc = nn.Linear(2048, num_classes) opt = AdamW(model.fc.parameters(), lr=1e-3)
How many parameters train?
ResNet-50: ~23.5 M backbone parameters; 2,048-d features into the head.
Explain it
Put what you saw into words. This is what the exam will ask you to do.
What is catastrophic forgetting, and when should you freeze the backbone versus fine-tune everything?
Code it
Write real code against real data. Python and SQL run right here in your browser and hidden tests check your work; the AI reviews it like an examiner.
How much will actually train?
Write trainable(num_classes, unfrozen) → number of trainable parameters when the new head is
nn.Linear(2048, num_classes) (with bias) and unfrozen is a list of stage names that are also trained.
Also share(num_classes, unfrozen) → trainable / total (backbone + head).
Challenge
Fixed variations, a new problem every day, and unlimited AI challenges built from your current settings.
Linear Probe Trainable Weights
You replace ResNet-50's final layer with nn.Linear(2048, 5) and freeze the entire backbone. How many trainable parameters are there?