Diffusion Models Beat GANs on Image Synthesis | ML Coding Series | Part 2 @TheAIEpiphany
Diffusion Models Beat GANs on Image Synthesis | ML Coding Series | Part 2  @TheAIEpiphany
Uploaded July 2022 | Updated September 2026, 1 week ago
❀️ Become The AI Epiphany Patreon ❀️
patreon.com/theaiepiphany

πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Join our Discord community πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦
discord.gg/peBrCpheKE

4th video in the ML coding series! In this one I continue explaining diffusion models! I cover the "Diffusion Models Beat GANs on Image Synthesis" paper and the code behind it.

I focus on how classifier guidance works. I cover both the training of the noise-aware classifier as well as the actual sampling (the mean shift method). I also walk you through a minor bug in their code.

Let me know how you find this format!

β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬
βœ… GitHub: github.com/openai/guided-diffusion
βœ… My issue: github.com/openai/guided-diffusion/issues/51
βœ… Paper: arxiv.org/abs/2105.05233
β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬

⌚️ Timetable:
00:00:00 Intro
00:01:30 Paper overview part - U-Net architecture improvements
00:05:38 Classifier guidance explained
00:15:18 Intuition behind classifier guidance
00:20:10 Scaling classifier guidance
00:24:10 Diversity vs quality tradeoff and future work
00:26:15 Coding part - training a noise-aware classifier
00:35:35 Main training loop
00:44:26 Visualizing timestep conditioning
00:46:00 Sampling using classifier guidance
00:52:35 Core of the sampling logic
00:59:20 Shifting the mean - classifier guidance
01:05:03 Minor bug in their code and my GitHub issue
01:07:53 Outro

β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬
πŸ’° BECOME A PATREON OF THE AI EPIPHANY ❀️

If these videos, GitHub projects, and blogs help you,
consider helping me out by supporting me on Patreon!

The AI Epiphany - patreon.com/theaiepiphany
One-time donation - paypal.com/paypalme/theaiepiphany

Huge thank you to these AI Epiphany patreons:
Eli Mahler
Petar VeličkoviΔ‡

β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬

πŸ’Ό LinkedIn - linkedin.com/in/aleksagordic
🐦 Twitter - twitter.com/gordic_aleksa
πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦ Discord - discord.gg/peBrCpheKE

πŸ“Ί YouTube - youtube.com/c/TheAIEpiphany
πŸ“š Medium - gordicaleksa.medium.com
πŸ’» GitHub - github.com/gordicaleksa
πŸ“’ AI Newsletter - aiepiphany.substack.com

β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬

#diffusion #generativemodeling #coding
Diffusion Models Beat GANs on Image Synthesis | ML Coding Series | Part 2Facebook AIs DINO | PyTorch Code ExplainedUltimate Guide To Scaling ML Models - Megatron-LM | ZeRO | DeepSpeed | Mixed PrecisionT0: Multitask Prompted Training Enables Zero-Shot Task Generalization | Paper ExplainedDay 17: Open NLLB - analyzing batch iterators (Pt 2)State Space Models w/ Albert Gu & Karan Goel (Cartesia AI)ConvNeXt: A ConvNet for the 2020s | Paper ExplainedVQ-GAN: Taming Transformers for High-Resolution Image Synthesis | Paper ExplainedDay 14: Open NLLB - exploring BLEU, chrF++, logging (Pt 3. cont.)DALL-E: Zero-Shot Text-to-Image Generation | Paper ExplainedDay 24: Open NLLB - back from China, analyzing spikes, preparing HBS run (Pt 2)OpenAI CLIP | Machine Learning Coding Series
Aleksa Gordić - The AI Epiphany |

Diffusion Models Beat GANs on Image Synthesis | ML Coding Series | Part 2

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER