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

About belief propagration implementation #9

Open
chunyang-wen opened this issue Jul 10, 2017 · 1 comment
Open

About belief propagration implementation #9

chunyang-wen opened this issue Jul 10, 2017 · 1 comment

Comments

@chunyang-wen
Copy link

In your paper, there are two schemes:

  • mean field
  • loopy belief propagation

in example of graph_classification, there is only implementation of mean field.

loopy belief propagation contains two phases:

  • v_i_j, message from i to j, gather all i's neighbor messages, except from j
  • v_i, message from all i's neighbor, plus its own message

I am curious about how to efficiently calculate v_i_j. Unlike mean field, it simply do matrix multiplication. But loopy belief propagation is some what complicated and it is not easy because we need to remove neighbor j when we calculate v_i_j. Of course, we can implement it by just set i's neighbor j to zero, when calculate v_i_j, but it is not efficient.

So any hint on that?

@Hanjun-Dai
Copy link
Owner

Hi there, please check out the pytorch implementation of structure2vec:
https://github.com/Hanjun-Dai/pytorch_structure2vec

It contains both efficient implementation of mean field and loopy bp.

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

No branches or pull requests

2 participants