Learning to manipulate latent representations of deep generative models