Repository navigation
Module 22
Level: Advanced
Scope: Advanced Extension
Status: Planned — navigation and lesson specifications
This module is a self-contained learning unit within the larger Deep Learning curriculum. Its purpose is to build understanding from motivation and prerequisites through mathematical reasoning, implementation and critical evaluation.
- Explain why pretrained representations can reduce label needs.
- Distinguish feature extraction, fine-tuning and domain adaptation.
- Explain catastrophic forgetting.
- Module-22-Lesson-Map
- Module-22-Important-Lessons
- Module-22-Numericals-and-Exercises
- Module-22-Implementation-Roadmap
- Module-22-Research-Extensions
- Module-22-transfer-learning-domain-adaptation-foundation-models
- Module-22-Lesson-01
- Module-22-Lesson-02
- Module-22-Lesson-03
- Module-22-Lesson-04
- Module-22-Lesson-05
- Module-22-Lesson-06
- Module-22-Lesson-07
- Module-22-Lesson-08
- Module-22-Lesson-09
- Study the lessons in prerequisite order.
- Write a notation sheet and derive central equations.
- Solve at least one hand-worked example per major mechanism.
- Implement core operations where appropriate.
- Verify outputs and gradients.
- Complete conceptual and coding exercises.
- Record limitations and research extensions.
- Conceptual understanding
- Mathematical derivations
- Worked numerical examples
- NumPy implementation (where applicable)
- PyTorch implementation (where applicable)
- Tests and numerical verification
- Experiments and interpretation
- Revision and self-assessment
Transfer learning reuses knowledge learned from a source task or domain. Domain adaptation addresses distribution differences between source and target. Foundation models are pretrained on broad data and adapted to downstream tasks, often with parameter-efficient methods.
A simple distribution-shift view distinguishes $$ P_s(X,Y)\ne P_t(X,Y). $$
Empirical target risk is $$ R_t(f)=\mathbb E_{(x,y)\sim P_t}[\ell(f(x),y)]. $$
A low-rank adaptation update can be parameterized as $$ W'=W+\Delta W,\qquad \Delta W=BA, $$ where the rank of BA is much smaller than the dimensions of W.
Freeze a pretrained encoder and train a small classification head. Then unfreeze the final block and compare validation performance, training cost and overfitting. This isolates the benefit of transferred representations.
flowchart TD
A[Pretrained source model] --> B[Choose target task]
B --> C{Adaptation strategy}
C --> D[Feature extraction]
C --> E[Full fine-tuning]
C --> F[PEFT: LoRA / adapters]
D --> G[Validate on target data]
E --> G
F --> G
Record the exact checkpoint, tokenizer, preprocessing, frozen parameters, trainable parameter count and data split. Compare linear probing, partial fine-tuning and LoRA under the same evaluation protocol.
Source and target domains may differ. Fine-tuning can cause catastrophic forgetting. Test data must not be used for model selection. A pretrained checkpoint's license and data provenance matter.
Study domain generalization, continual learning, adapters, prompt tuning, LoRA/QLoRA, model merging and data-efficient adaptation.
- Reproduce the smallest mathematical example by hand.
- Implement the central operation using NumPy.
- Implement the same operation using PyTorch.
- Compare outputs and gradients with numerical tolerances.
- Change one assumption or hyperparameter and document what changes.
- Record environment, random seed, data split, compute budget and limitations.
- Explain the motivation and assumptions without notes.
- Derive the principal equations and define every symbol.
- Complete at least one worked numerical example.
- Trace tensor shapes through the computation.
- Implement and test the central mechanism.
- Explain at least two failure modes.
- Read one primary paper and summarize its contribution and limitations.
Content status: This page now contains a technical chapter and a practical learning specification. The linked lesson pages provide focused subtopic treatment; experiments are not claimed complete until their result logs are added.
🏠 Home · 🗺️ Curriculum · 🧭 Learning paths · ❓ Question bank · 📖 Glossary · 📚 References · ✏️ Contributing
🏠 Home · 🗺️ Curriculum · 🧭 Learning paths
❓ Question bank · 📖 Glossary · 📚 References
Jump to module:
01 02 03 04 05 06 07 08 09 10 11 12
13 14 15 16 17 18 19 20 21 22 23 24