Amortizing intractable inference in diffusion models for vision, language, and control