Bayesian Inference with Nonlinear Generative Models: Comments on Secure Learning