Machine Learning Diffusion Models From Scratch