I am would like to use LBFGS and StaticSVI for MAP estimation instead of AutoGuide/AutoDelta combined with other optimizers since the latest is not giving me stable results,
I have been investigating several threads about the topic:
and followed the examples, like this:
loss_fn = TraceEnum_ELBO(max_plate_nesting=2).differentiable_loss
with pyro.poutine.trace(param_only=True) as param_capture:
params = [site[“value”].unconstrained() for site in param_capture.trace.nodes.values()]
optim = torch.optim.LBFGS(params, lr=0.1)
svi = StaticSVI(model, global_guide, optim, loss=Trace_ELBO())
However, obviously, pyro’s SVI doesn’t work with not default optimizers and raises the error:
raise ValueError("Optimizer should be an instance of pyro.optim.PyroOptim class.") ValueError: Optimizer should be an instance of pyro.optim.PyroOptim class.
So maybe I am missing something from the threads but, is there any possibility to make this 2 work together? I can make StaticSVI work with the default pyro optimizers. Is there any plan to implement LBFGS?
Thanks for your time and attention