Inference and learning in nonlinear latent variable models