import matplotlib.pyplot as plt
from dlbook.figures import plot_curriculum_map
plot_curriculum_map()
plt.show()
From linear models to modern neural networks
Deep learning connects a simple idea—learning from examples—to models that recognize images, understand language, and generate new content. This book develops that connection step by step. You will begin with linear regression, build and train neural networks, and explore the architectures behind modern vision, language, and generative models.
Throughout the book, we return to three questions: What can a model represent? How can we train it? How can we adapt it to a new task? Understanding these questions will help you make informed choices when a new architecture, dataset, or application comes along.
This is an executable textbook for a 15-week bachelor-level course. Mathematical explanations sit alongside runnable examples, visualizations, exercises, and experiments. You can read a derivation, inspect its implementation, and then change the assumptions to see what happens.
Examples from digital health connect the methods to concrete problems. These applications also raise questions that matter well beyond medicine: How should we split data? What happens when the data distribution changes? Which errors matter? And how far do our results generalize?
The book moves from foundations to specialized architectures, then brings them together through adaptation and comparison. Training and evaluation accompany the models throughout.
| Part | Weeks | Main topics | Guiding question |
|---|---|---|---|
| I. Foundations of Learning | 1–4 | Linear regression; linear classification; optimization and regularization; multilayer perceptrons and backpropagation | How do we define, train, and evaluate a model? |
| II. Spatial, Generative, and Relational Models | 5–8 | CNNs and ResNets; transfer learning and U-Net; diffusion; sets, multiple-instance learning, and graph neural networks | How do we build models for images, collections, and relationships? |
| III. Sequence Models and Transformers | 9–12 | RNNs and GRUs; attention and Transformer blocks; GPT, BERT, and self-supervised learning; encoder–decoder models and fine-tuning | How do models learn from sequences and use context? |
| IV. Efficient Models and Synthesis | 13–15 | Vision Transformers and visual self-supervised learning; Mamba and distillation; architecture selection and reproducible comparison | How do we adapt and compare models for a task and a computing budget? |
import matplotlib.pyplot as plt
from dlbook.figures import plot_curriculum_map
plot_curriculum_map()
plt.show()
Start with Getting Started for the Python setup, then read Linear Regression and work through its lab. For a first reading, follow the course order: later chapters build on the notation, training methods, and experimental habits introduced earlier. When working on your project, return to the relevant chapters as a reference.
You do not need prior experience with deep learning or PyTorch. Familiarity with basic Python, vectors and matrices, derivatives, and elementary probability will help you get started. The chapters revisit mathematical ideas as they become relevant; use the accompanying examples to connect the notation to the code, and bring questions about unfamiliar steps to the sessions.
Keep track of tensor shapes, what each symbol represents, and which quantities are learned. These small habits make both derivations and implementations easier to understand.
The course uses a flipped classroom format with two sessions each week. Reading and preparation introduce the ideas; the sessions give you time to apply them, ask questions, and work through difficult steps together.
When running an example, first predict what you expect to happen. Then change a parameter, an architectural choice, or a data assumption and compare the outcome with your prediction. A surprising result is an opportunity to inspect the model and revise your understanding.
If you use coding assistants, check their output against the mathematics and the experiment’s purpose. You should be able to explain the objective, data flow, and evaluation procedure in your own words.
At the end of the semester, you will complete a coding project that brings together methods from the course. You will apply what you have learned to a concrete problem, evaluate your approach, and explain your results and their limitations. The chapters and labs provide examples and techniques you can return to when developing your solution. The project requirements and assessment criteria will be provided separately.
Begin with the foundations, and keep the three recurring questions in view: representation, training, and adaptation.