Learning with latent variables is now functional.

Changes: allowing edge-less graphs.