Adaptive Density Estimation for Generative Models