Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can edward "read" a bayes network? #18

Open
rose1203 opened this issue May 11, 2018 · 4 comments
Open

How can edward "read" a bayes network? #18

rose1203 opened this issue May 11, 2018 · 4 comments
Labels

Comments

@rose1203
Copy link

Hi, I read your program about inference with edward, but I don't understand how to load a bayes network which is in a bif format.
Can you help me ?
THANK YOU!

@rrtucci
Copy link
Contributor

rrtucci commented May 11, 2018

QEdward cannot load B. Nets. It only works for quantum circuits broken up into layers. I've written two models for it. To see a typical use, look at the main() at the end of Fitter.py.

So, what you are trying to do would be a nice enhancement for Q Edward but not possible yet. However, I have written a baby step in your preferred direction, for classical (not quantum yet) b nets.

In the folder

https://github.com/artiste-qb-net/quantum-fog/tree/master/jupyter-notebooks/inference_via_ext_software

I show how to read a bif, translate it into an Edward (classical) model, and then analyze that using the KLqp algorithm. The KLqp algorithm is the same the BBVI algorithm used by QEdward

@rose1203
Copy link
Author

@rrtucci
I have read it and found it very useful! But where can I find the "graphs.BayesNet"and "WetGrass.bif" ?
THANKS

@rrtucci
Copy link
Contributor

rrtucci commented May 13, 2018

The bif file is in
https://github.com/artiste-qb-net/quantum-fog/tree/master/examples_cbnets

The class BayesNet is in the file BayesNet.py in the folder called graphs
https://github.com/artiste-qb-net/quantum-fog/tree/master/graphs

I follow a JAVA convention of putting one class per file and naming the class and file the same

@rose1203
Copy link
Author

@rrtucci THANKS!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants