I am trying to implement Switching Dynamic Linear System with Pyro
Nice! Do you have an interest in contributing that to pyro/examples/? I think it would be easier to discuss this model in a PR rather than a forum thread.
Is their any document on the objective function if enumeration is involved?
The objective function is simply the ELBO. Even when we do MAP estimation, we maximize ELBO with a trivial delta guide.
p(z,x)
ELBO = sum q(z|x) log ------
z q(z|x)
In enumeration we split z into say three parts: non-enumerated z1, guide-enumerated z2, and model-enumerated z3.
sum p(z1,z2,z3,x)
z3
ELBO = sum sum q(z1,z2|x) log -----------------
z1 z2 q(z1,z2|x)
Note that sum z1 q(z1|x) is implemented via Monte Carlo, whereas sum z2 q(z2|x) is implemented via weighted enumeration in the guide, and sum z3 p(z3) is implemented via weighted enumeration in the model. I’ll try to add a clearer explanation to our upcoming enumeration tutorial.