The Principles of Diffusion Models