jmschrei / pomegranate

Fast, flexible and easy to use probabilistic modelling in Python.
http://pomegranate.readthedocs.org/en/latest/
MIT License
3.35k stars 589 forks source link

Baking CPT that are in a loop #578

Closed 13charliebrown closed 4 years ago

13charliebrown commented 5 years ago

I am creating a Bayesian network and to build the nodes some discrete distributions and CPT take values from a loop, so they need to be defined as a function of this loop. The problem is that when I bake the model I don't get the values of the network. The main file I am working with is main.py and final_probabilities.py. I hope you can help. I attach the modules. The file works perfectly well without being in the loop. bayesian_frm.zip

jmschrei commented 4 years ago

While it is true that the loopy belief propogation algorithm implemented in pomegranate theoretically allows for cyclic Bayesian networks (and CPTs) to be built, the actual implementation doesn't allow for it. Given that this algorithm is very unstable, I haven't considered it to be a priority to add in.