PGMax
PGMax copied to clipboard
add example of learning a directed graphical model
It would be cool to show how to fit an HMM with Gaussian local evidence potentials. The model would be
p(z(1:T)) = 1/Z prod_{t=1} Psi(z(t), z(t-1)) Phi(z(t))
Psi(z(t), z(t-1)) = p(z(t)|z(t-1))
Phi(z(t)) = gauss(x(t) | mu_{z(t)}, sigma I)
You use LBP to compute the (exact!) marginal likelihood and then do gradient descent for the params. Or you could recreate our discrete HMM example at https://github.com/probml/JSL/blob/main/jsl/demos/hmm_casino_sgd_train.py
It would be great also just to have an example of inference in a directed graphical model. e.g. just the standard sprinkler example would be really useful for getting a handle on how to use the package.