Tutorials
Each tutorial is a Jupyter notebook in the repository’s tutorials/ folder. The pages here show each notebook with the outputs of its last complete run. The first code cell of every notebook installs Dew from GitHub, and the top of the notebook names the hardware it needs; the Colab link opens it ready to run.
Notebooks 01 to 04 cover image diffusion and build on each other: 04 samples from the checkpoint 02 trains. The others stand alone. The Quickstart introduces the objects every notebook uses and runs on a CPU in seconds.
Basics of Diffusion based generative models from ScratchPlease bear with me at times and read through the entire notebook thoroughly.Train a diffusion model with DewThis is part 2 of the series, and so I would strongly recommend going through Notebook 01 first.Text to image with classifier-free guidanceThis is part 3 of the series, and it builds directly on notebook 02, so I would recommend going through that one first.Samplers and schedulesA trained diffusion model only tells us, for a noisy image, what it thinks the clean image is.Train a language modelSo far we have only generated images. But the same Trainer trains language models too, and in this notebook we shall train a small decoder-only transformer on FineWeb-Edu, a large collection of…Learn image representations with I-JEPAWe train an encoder whose only product is a vector for each image, and the goal is that similar images get similar vectors.Scale one training run across many devicesWhen I trained text-to-image models from scratch with FlaxDiff, Dew's predecessor, it was on 128 TPU v4 chips.Load a pretrained decoder and keep training itIn notebook 05 we trained a language model from random weights. But most of the time, you would start from a model someone else already trained, on far more data than we have.SFT for LLMsSupervised fine-tuning (SFT) trains a language model on examples of the replies we want.Reinforcement learning with verifiable rewardsSupervised fine-tuning is easy to explain: show the model the right answer and make that answer more likely. But for a lot of the problems we care about, nobody has written the right answer down.LLMs in an agent harness for long-horizon tasksAn agent is a language model that works over many turns. It writes something, a tool runs it, the tool's answer comes back as text, and the model writes again.World models: acting and imagining in one loopSuppose you have taught a program to balance a pole on a cart by letting it practise in a simulator, pushing the cart left and right millions of times until it stops dropping the pole.Continual learning in contextA trained language model is frozen: whatever it reads, its weights stay where training left them.A racing drone that flies from its cameraWatch a first-person drone race and ask yourself what the pilot actually has to go on: a wide, rushing camera image, the body rates and rotor speeds the drone senses about itself, and a supplied…