question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Message passing for directed graphs

See original GitHub issue

Hi, thanks for the great package. I find some potential unclarity of the message passing mechanism when applied to directed graphs. In particular, the edge_index includes pairs of (i, j) in the edge set, but the aggregation associated with the MessagePassing class works by aggregating features from x_j to x_i, i.e. from target nodes to source nodes. This is fine for undirected graphs, but for directed graphs, we actually want to aggregate features flowing into a node (usually not the opposite way), so x_j should be the “source node” and x_i should be the “target node”. I find these terminologies in the documentation about “source” and “target” a bit misleading.

Perhaps if not changing the aggregation direction in the MessagePassing code, in the definition of edge_index, we should make it clear that a pair (i, j) in edge_index means that there is an edge from j to i, i.e. in the direction of j -> i. This does not influence undirected graphs but helps to reduce errors in dealing with directed graphs.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Mar 13, 2019

Added to current master!

1reaction
jzhou316commented, Mar 12, 2019

Both are fine. 1 is perhaps more systematic? Seems can do a minimal change by modifying edge_index to edge_index[torch.LongTensor([1, 0])] in MessagePassing.propagate() according to the direction flag.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Graphical models and message-passing algorithms
A directed acyclic graph, or DAG for short, is a directed graph that contains no di- rected cycles. As an illustration, the graphs...
Read more >
Message Passing, Directed Acyclic Graphical Models
This graph is not just a visualization tool: Can be used to test arbitrary conditional independences (“d-separation”). Graph structure tells us whether message...
Read more >
Directional Message Passing for Molecular Graphs - arXiv
We propose a message passing scheme analogous to belief propagation, which uses the directional information by transforming messages based on ...
Read more >
Graphical Models and Message passing
Undirected graphical model. Directed graph and Undirected graph. Message passing and sum-product algorithm. Factor graphs.
Read more >
Introduction to Message Passing Neural Networks
Welcome to the world of graph neural networks where we construct deep learning models on graphs. You could think that is quite simple....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found