Optimizing log prob of a model


New Pyro user here, Stan user for a few years. I’m still getting used to Pyro’s differences compared to Stan, but one thing I could not find any mention of is obtaining point estimates (Stan calls this method optimize, for reference, and simply uses LBFGS to climb the posterior).

I’ve written some PyTorch code by now so I’m sure there’s a way to take my model and apply an optimizer, but the sites stuff is throwing me off and I’d like a hint if possible.

Does anyone have an example of doing this?

Hi maedoc,

I believe the way to get point estimates is by using the AutoDelta automated guide generation function found here:

See the example for Gaussian Mixture Models for how to use them:


oops, I even read the docs on that but hadn’t realized that a delta distribution would do that.

1 Like