DL Basics — PyTorch MLPs, CNNs, Sequences, Fine-Tuning Discipline
Back to M4 — Fine-Tuning Discipline + Defense

Fine-Tuning Discipline (Freeze Schedules, LR, Leakage, Eval)

Outcome: write eval protocol shared by both mini-labs. Curated video (9:24, verified 2026-09-24 via yt-dlp): Freezing vs. Unfreezing Layers: The Ultimate Guide to Transfer Learning (SH AI Academy) Watch: https://www.youtube.com/watch?v=FcG-xaWBvlI Notes: Feature extraction vs fine-tuning; freeze schedules, when/how to unfreeze, LR discipline. Lab: write the eval protocol (leakage + eval rules) shared by both mini-labs. Key moments: No chapter markers on source; key beats: freezing rationale, unfreeze schedule, LR guidance, eval pointers.

9 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.
Loading progress...

Key moments

  1. Fine-Tuning Challenges — Identifies risks of catastrophic forgetting and gradient shock during transfer learning.
  2. Freeze Schedules & Gradual Unfreezing — Demonstrates disabling gradients on pretrained backbones before selectively opening top layers.
  3. Differential Learning Rates — Sets up parameter group dictionaries with distinct learning rates inside PyTorch optimizers.
  4. Preventing Data Leakage — Separates training augmentations from deterministic validation transforms and dataset statistics.
  5. Shared Evaluation Protocol — Constructs the reusable evaluation harness using eval mode and no-grad contexts for mini-labs.
PDF notes

Frequently asked questions

Why does training a head without freezing the backbone lead to catastrophic forgetting?

Randomly initialized head weights produce massive initial gradients that rapidly destroy calibrated feature representations in earlier layers.

How does torch.no_grad() differ from model.eval()?

torch.no_grad() disables autograd tape recording to save memory, whereas model.eval() changes module runtime behaviors like dropout and batchnorm.

When should gradual unfreezing be preferred over full fine-tuning immediately?

Gradual unfreezing is preferred when working with small downstream datasets to prevent overfitting and gradient shock.

How was this lesson?

Your feedback helps us refine explanations and catch bugs.