A Variational Perspective on Diffusion-Based Generative Models and Score Matching