Parameter learning of hidden(latent) nodes for arbitrary bayesian network


The following notebook runs without reporting errors but gives random junk answers. If anyone is interested in the same topic, and finds why it doesn’t work, I’d appreciate finding out how to fix it.

The notebook writes an edward model for
the classic bayesian net “WetGrass” that looks like this with all arrows pointing down

  /      \
Rain   Sprinkler
  \      /

The goal is to learn the node conditional prob tables of two latent (hidden) nodes Rain and Sprinkler, given data consisting of multiple observations of the nodes Cloudy and WetGrass. I use batch training and KLqp Inference.


Update (March 9, 2018)

Found serious conceptual mistake in previous notebook so deleted it. Wrote 2 new notebooks without previous mistake. Neither of them gives error message, but both fail to converge, so still need help