Latent Space Optimization with Deep Generative Models