Closed Abusagit closed 2 months ago
Hi, the reason why we transpose the edges is that the standard representation of the adjacency matrix $\boldsymbol{A} \in \mathbb{R}^{N \times N}$ has nonzero entries in $a_{ij}$ if there is an edge going from $i$ to $j$. To receive messages from your incoming 1-hop neighbors, you thus have to compute $\boldsymbol{A}^{\top}\boldsymbol{X}$. The edge_index
representation, instead, gives you the sparse COO format of $\boldsymbol{A}$.
By doing these operations, we ensure to always abide by the PyG's convention for message passing (See https://pytorch-geometric.readthedocs.io/en/latest/advanced/sparse_tensor.html).
Oh, Indeed, now it's clear for me, thank you! I feel like I forgot this convention in PyG :)
Then I close the issue, thank you for such fast reply!
Hello!
Could you please clarify what is the reason for transposing adjacency matrix in
get_connectivity
method withlayout="edge_index"
option?For directed graphs, this method returns reflected edges:
Also,
connectivity_dense
is equal to adjacency from the original work. This behaviour oflayout="edge_index"
seems misleading for me.Looking forward to your answer, thank you!