Tutorials
Each tutorial is a Jupyter notebook in the repository’s tutorials/ folder, and each page here shows the notebook with the outputs from its last complete run. Open one in Colab to run it yourself: the first cell installs Dew from GitHub, and the notebook says at the top what hardware it needs.
Notebooks 01 to 04 are about image diffusion and build on each other: 04 samples from the checkpoint that 02 trains. The others stand alone. If you have not used Dew before, read the quickstart first; it trains a model in a few seconds on a CPU and introduces the pieces every notebook uses.
Diffusion models from scratchIn this notebook we build a diffusion model by hand: the noise schedule, the loss, the network and three samplers, each in a few lines of JAX and Flax.
Train a diffusion model with DewNotebook 01 builds a diffusion model by hand: the noise schedule, the loss, the network and the samplers.Text to image with classifier-free guidanceThe model in notebook 02 learns what flowers look like, but we cannot tell it which flower to draw.
Samplers and schedulesA trained diffusion model only tells us, for a noisy image, what it thinks the clean image is.
Train a language modelIn this notebook we train a small decoder-only transformer on the complete works of Shakespeare, one byte at a time, and then let it write.Learn image representations with I-JEPAThe earlier notebooks train models that produce something: an image or text.Scale one training run across many devicesWhen a model or its batch outgrows one accelerator, we spread the work over several. In Dew that is one argument to the Trainer: a MeshSpec that arranges the devices into named axes.Load a pretrained decoder and keep training itNotebook 05 trains a language model from random weights. Most of the time you start from a model someone else already trained.
Train a diffusion model with DewNotebook 01 builds a diffusion model by hand: the noise schedule, the loss, the network and the samplers.Text to image with classifier-free guidanceThe model in notebook 02 learns what flowers look like, but we cannot tell it which flower to draw.
Samplers and schedulesA trained diffusion model only tells us, for a noisy image, what it thinks the clean image is.
Train a language modelIn this notebook we train a small decoder-only transformer on the complete works of Shakespeare, one byte at a time, and then let it write.Learn image representations with I-JEPAThe earlier notebooks train models that produce something: an image or text.Scale one training run across many devicesWhen a model or its batch outgrows one accelerator, we spread the work over several. In Dew that is one argument to the Trainer: a MeshSpec that arranges the devices into named axes.Load a pretrained decoder and keep training itNotebook 05 trains a language model from random weights. Most of the time you start from a model someone else already trained.