Exercise 5: Generative modeling