Hanjun-Dai / graphnn

Training computational graph on top of structured data (string, graph, etc)
MIT License
287 stars 91 forks source link

About belief propagration implementation #9

Open chunyang-wen opened 7 years ago

chunyang-wen commented 7 years ago

In your paper, there are two schemes:

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

loopy belief propagation contains two phases:

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 commented 6 years ago

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.