In the machine learning community in the context of Diffusion Models, there has been a big interest in Stochastic Differential Equations (SDEs) recently. SDEs are a powerful concept driving powerful generative AI tools from image generation (see DALL-E-2 or Stable Diffusion) to protein generation (see RF-Diffusion). However, the accompanying papers assume understanding of complex results from the theory of SDEs - such as the time-reversal formula. As a result, the works are more and more inaccessible for non-SDE experts. This blog post aims to help out here and give a self-contained introduction to SDEs for diffusion models. All mathematical results for SDEs that are used for diffusion models are proven here. More specifically, in this tutorial, you will know:
First time hear about SDEs?: If you have never heard about SDEs, I would recommend you to first read my previous tutorial where I explore the Langevin SDE that is fundamental for machine learning.
More interested in practical implementations? in my next tutorial, we are going to put the theory into practice.
Required background: I assume that you have background knowledge in probability theory.
Acknowledgement: the content of this tutorial has partially grown out of several nights trying to understand the famous diffusion model SDE paper by Song et al..
import numpy as np
import matplotlib.pyplot as plt
from typing import Callable, List
from itertools import product
from tqdm.notebook import tqdm
#!pip install ipywidgets
from celluloid import Camera # getting the camera
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import HTML
import seaborn as sns
from IPython.display import Video
import os
import pandas as pd