Level 3 project
Transfer Learning Across a Real Dataset
Start from the canonical project files, validate the result, and keep the evidence you need to explain what you built.
There is no upload or grading service. Run the documented validator or checks where applicable, keep the results, and score your own evidence against the rubric below. A passing check by itself does not mean the project is complete. Suggested strong-evidence target: 90/100.
Start here
Launch lesson: Adaptation Review: Choose, Fine-Tune, Explain
Prerequisite project: Neural Network From Scratch
Prerequisites
Python help for this project:
Complete Level 3 through L3.14 — Adaptation Review: Choose, Fine-Tune, Explain. The canonical project depends on p02-neural-net-from-scratch, so you should already be able to reason about tensor shapes, training curves, gradients, and reproducible comparisons.
Goal
Starting from the provided scaffold:
- pretrain the source model;
- complete
build_frozen_transfer; - complete
fine_tune; - compare scratch, frozen transfer, and fine-tuning fairly;
- add a noisy-image failure slice;
- intentionally fine-tune with an aggressive learning rate and explain the failure evidence.
Task
- Completed
adaptation.py. REPORT.mdbased onREPORT_TEMPLATE.md.- Checker output.
- A strategy decision that uses at least three pieces of evidence.
Your report must include source-task accuracy; scratch, frozen-transfer, and fine-tuned target accuracy; trainable parameter counts; encoder movement; clean/noisy-slice accuracy; the aggressive-learning-rate failure; provenance notes; and a final strategy decision.
Stuck on a TODO?
Choose one function at a time. Hint 1 offers direction, hint 2 offers pseudocode, and hint 3 reveals only that function's reference implementation after confirmation.
adaptation.py: build_frozen_transfer()
Try the starter function and run its validator before revealing the reference.
Hints for this TODO
adaptation.py: fine_tune()
Try the starter function and run its validator before revealing the reference.
Hints for this TODO
Validation
Run these commands from the downloaded Project folder or the public materials repository root.
python projects/tests/l03/check_submission.py projects/starters/l03Compare with a reference
First complete your own TODOs and run the submission validator above. Then open the published reference solution. Reference acceptance tests check the completed reference, not your submission:
python projects/tests/l03/test_reference.pyRubric
Total: 100 points. The project measures the Level 3 exit skills directly.
| Criterion | Points | Observable evidence |
|---|---|---|
| Representation / transfer reasoning | 15 | Explains what the source encoder learned, why the target task is related, and why transfer is a hypothesis rather than a guarantee. |
| Functional frozen transfer | 15 | Reuses the pretrained encoder, freezes it correctly, trains a new head, and reports reproducible validation evidence. |
| Controlled fine-tuning | 15 | Starts from the same frozen checkpoint, unfreezes the encoder, uses a conservative learning rate, and measures encoder movement. |
| Fair strategy comparison | 15 | Scratch, frozen transfer, and fine-tuning use the same target split, preprocessing, seed policy, validation set, and metric. |
| Failure analysis | 10 | Includes the required noisy-image slice with a precise perturbation definition, seed, clean control, and interpretation. |
| Intentional failure and debugging | 15 | Runs aggressive fine-tuning, records movement/quality evidence, forms a causal hypothesis, restores the correct checkpoint/configuration, and verifies the fix. |
| Reproducibility / provenance | 10 | Records Python/package versions, seed, CPU/GPU condition, dataset provenance, and clean-start/checker evidence; no credentials are required. |
| Communication / decision | 5 | Chooses a strategy using at least three pieces of evidence and names a real tradeoff rather than claiming one method is universally best. |
Performance anchors
Full credit
The implementation is reproducible, all three strategies are fairly compared, frozen and fine-tuned behavior are technically correct, and the final decision is supported by metrics, movement, failure slices, and resource/reproducibility evidence.
Partial credit
The code mostly works but one exit skill is weak—for example, transfer is implemented but the comparison changes the split, or fine-tuning succeeds without measuring movement or debugging the aggressive run.
Insufficient
The submission changes the canonical task, uses different validation data for each strategy, leaks validation labels into training, treats a pretrained label as proof of quality, cannot reproduce its result, or reports only one overall accuracy.
Self-check before you call it done
- Can you show the source/target provenance, shared target split, metrics, seed, environment, and checker result?
- Can you identify the frozen encoder, head training, and measured encoder movement when fine-tuning from the same checkpoint?
- Can you compare scratch, frozen, and fine-tuned runs fairly and justify a strategy using three pieces of evidence?
- Can you reproduce the noisy-image slice and aggressive fine-tuning failure, including the fix and its measured result?