Flow Matching and Diffusion Models Explained

Introduction Flow matching and diffusion models generate images, videos, and other kinds of data by gradually transforming random noise into new samples. I first encountered diffusion models in 2022 through latent diffusion models such as Stable Diffusion 1.5, and I have been working with them since 2023. As a machine learning practitioner, I found training these models much easier than understanding why they worked. With the available tools, enough data, and enough compute, I could train models for production without fully understanding their mathematical foundations. I trained many such models, but my impostor syndrome kept haunting me anyway. Apart from keeping that inner voice quiet, I wanted to understand how these models work and, more importantly, why they work. Most explanations I found were either too mathematically heavy for a humble ML practitioner like me or so simplified that they missed the point. ...

October 5, 2026 · 48 min · Dariush

Understanding Precision and Recall

Introduction When I first learned about precision and recall, I found them confusing — but later realized these metrics are actually very intuitive. They just need the right context to click. The best way to think about them is through the confusion matrix. Once you understand the confusion matrix, precision and recall become natural and easy to reason about. Confusion Matrix The figure below shows a confusion matrix for a binary classification task: ...

June 5, 2026 · 3 min · Dariush