fast.ai Course
These are worked notebooks from the two fast.ai courses, which are deliberately taught in opposite directions.
Part 1 is top-down. You train and deploy a working model in the first lesson, then peel back layers to find out why it worked. Part 2 inverts that: it starts from matrix multiplication and rebuilds the training framework piece by piece, until the thing you have built is capable of training a diffusion model.
That second half is the reason this repo exports a library. Each foundations notebook adds to fastAIcourse, so by the end the package contains a small working deep learning framework assembled in course order.
Install
pip install fastAIcourseThe library is the accumulated output of the Part 2 notebooks: learner, activations, init, sgd, accel, resnet, augment, convolutions, datasets, training, ddpm, diffusion, and fid. Each module comes from the notebook of the same name.
Part 1: Practical Deep Learning
Top-down. A working model first, explanations after.
| Page | Covers |
|---|---|
| Getting Started | Training the first model |
| Deployment | Putting it somewhere people can use it, which comes second here rather than last |
| Neural Net Foundations | Stochastic gradient descent, and why linear layers plus non-linear activations are flexible enough to fit anything |
| How a Neural Net Really Works | Fitting a function with gradient descent, worked slowly |
| Natural Language Processing | Text classification with pretrained language models |
| Linear Model and Neural Net from Scratch | No pre-built architecture, optimizer, or data loading, to see what the framework was doing |
| Why You Should Use a Framework | The counterargument, immediately after |
| How Random Forests Really Work | The non-neural baseline that often wins on tabular data |
| Kaggle Tutorial | Competing as a way of learning |
| Multi-Target | Predicting several things at once |
| Collaborative Filtering | Recommendation through learned embeddings |
| Tabular Modeling | The long one, at 288 cells |
| A Hacker’s Guide to Language Models | What LLMs are and how to actually use them |
Stable Diffusion, Top Down
Part 2 opens by using diffusion models before explaining them.
| Page | Covers |
|---|---|
| Overview | What the pieces are |
| Stable Diffusion with Diffusers | Driving it through Hugging Face, including attention slicing to trade speed for memory |
| Deep Dive | Taking the pipeline apart |
Part 2: Foundations
Rebuilding the framework from the bottom. Most of these notebooks export into fastAIcourse.
| Page | Covers |
|---|---|
| Matrix and Tensor | Matrix multiplication, from Python loops to broadcasting, at 234 cells |
| Backpropagation | The chain rule, written out |
| Mini-Batch Training | The training loop taking shape |
| Hugging Face Datasets | Getting data in |
| Foundations | Callbacks and the machinery the learner needs |
| Convolutions | Building the operation, not calling it |
| Learner | The central abstraction that ties the loop together |
| Activation Stats | Instrumenting a model to see what its layers are doing |
| Initialization | Why starting weights decide whether training works at all |
| Accelerated SGD | Momentum, RMSProp, Adam |
| ResNets | Residual connections |
| Augmentation | Getting more out of the data you have |
Diffusion Models
Where Part 2 lands, once the framework exists to train them.
| Page | Covers |
|---|---|
| DDPM with miniai | Denoising diffusion probabilistic models, the first implementation |
| DDPM v2 | The second pass |
| DDPM v3 | The third |
| DDIM | Implicit models, which sample in far fewer steps |
| Karras Pre-conditioning | The reformulation that made sampling schedules tractable |
| Cosine Schedule | Choosing how noise is added over time |
| Noise Prediction | Predicting how noisy a FashionMNIST image is |
| Diffusion U-Net | The architecture doing the denoising |
| Attention | Adding attention to it |
| Conditioned Diffusion | Guiding generation with a condition |
| FID | Scoring generated images, since you cannot eyeball a distribution |
Experiments and Applications
| Page | Covers |
|---|---|
| Style Transfer | Optimising an image against a style |
| Neural Cellular Automata | Growing an image from local update rules |
| CIFAR-10 with Weights and Biases | Classification with experiment tracking attached |
| Tiny ImageNet | The baseline run |
| Tiny ImageNet, Widish | Wider, as a comparison |
| Tiny ImageNet, Wide | Wider again |
| Tiny ImageNet 200 | The full 200-class version |
| Super-Resolution | Upscaling |
Not Covered Yet
- These are course notebooks, not a reference. They follow the lessons, so coverage is whatever the course covered and the ordering is pedagogical rather than logical. For a reference treatment see DL Methods.
- No transformer or LLM training. Part 2 ends at diffusion; attention appears only as a component of the U-Net.
- Several pages have placeholder titles. Style Transfer and NCA are titled “Setup” and “Setup 2” internally, and the four Tiny ImageNet notebooks share one title, which is why the sidebar reads poorly.
- The three DDPM versions are not distinguished by their titles, so which to read is not obvious.
180_autoencoder.ipynbsits in the repo root rather thannbs/, so it is neither published nor part of the library.- The library has no documentation of its own beyond the notebooks that built it, so the exported API is only discoverable by reading them in order.