Phase 1: Convolutional Neural Networks · ~75 minutes · Python
Image Generation — Diffusion Models
A diffusion model learns to denoise. Train it to remove a tiny bit of noise from a noisy image, repeat that backwards a thousand times, and you have an image generator.
What you will learn
- Derive the forward noising process `x_0 -> x_1 -> ... -> x_T` and explain why the closed-form `q(x_t | x_0)` holds for any t
- Implement a DDPM-style training objective that regresses the noise added at each step, and a sampler that walks back from pure noise to an image
- Build a time-conditioned U-Net (small enough to train on CPU) that predicts the noise for any timestep
- Explain the difference between DDPM and DDIM sampling, and when each is appropriate (Lesson 23 covers flow matching and rectified flow in depth)
Introduction
- Type: Build
- Languages: Python
- Prerequisites: the Math for AI & ML course, the Deep Learning from Scratch course, Optimizers
- Time: ~75 minutes
Objective
Learning objectives
- Derive the forward noising process
x_0 -> x_1 -> ... -> x_T and explain why the closed-form q(x_t | x_0) holds for any t - Implement a DDPM-style training objective that regresses the noise added at each step, and a sampler that walks back from pure noise to an image
- Build a time-conditioned U-Net (small enough to train on CPU) that predicts the noise for any timestep
- Explain the difference between DDPM and DDIM sampling, and when each is appropriate (Diffusion Transformers & Rectified Flow covers flow matching and rectified flow in depth)
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers The Problem, The Concept, Build, Check Yourself, Key Terms & Next — plus a hands-on lab, quiz, and project artifact.
Create a free account — the opening phases of 29 of 35 courses are free, no credit card.
Browse all courses · View pricing · DeVenture Academy