Optimizing log prob of a model

Hi

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:
http://docs.pyro.ai/en/0.2.1-release/contrib.autoguide.html?highlight=autodelta#autodelta

See the example for Gaussian Mixture Models for how to use them:
http://pyro.ai/examples/gmm.html#MAP-estimation

2 Likes

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

1 Like