The statistical thermodynamics of generative diffusion models