Hypergraph Attention in PyG #5152
Replies: 11 comments 20 replies
-
Are you sure you are dealing with hypergraphs here? This sounds like a normal adjacency matrix to me, which you can input into |
Beta Was this translation helpful? Give feedback.
-
@rusty1s We are using the Cora dataset here. Here is how we generated graph data:
According to your suggestion, if we make it [2, num_edges], then our edge connection matrix will be of size [2, 2577]. But in our case each edge has a sequence of nodes, for instance, in an edge there could be 10, or somewhere it could be 50 nodes. I will show you an example from hypernetx library |
Beta Was this translation helpful? Give feedback.
-
We have data in this form except, we are using the lists and they are using tuples, however, both work. |
Beta Was this translation helpful? Give feedback.
-
In the above example, there are 8 edges with 13 nodes. We have a data structure like that, however, we have 2577 edges with 2703 nodes. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I will do it. :) |
Beta Was this translation helpful? Give feedback.
-
I encode it. The shape of hypergraph_index is [2, 174601]. The number of hyperedges is 2577. It's because there are a lot of nodes in each hyperedge, right? |
Beta Was this translation helpful? Give feedback.
-
code used to generate encoding |
Beta Was this translation helpful? Give feedback.
-
@rusty1s There is a problem when I pass x (tensor: 2708 x 1433) and hyperedge_index (tensor: 2 x 2577) to HypergraphConv's forward method. It gives me the Run time Error: 100002 is a node ID, and I am using it in my hyperedeg_index tensor because these node ids make connections in the hypergraph. Could you please tell me what's wrong? |
Beta Was this translation helpful? Give feedback.
-
Does it mean we should rename the nodes ID's? |
Beta Was this translation helpful? Give feedback.
-
@rusty1s can we use: |
Beta Was this translation helpful? Give feedback.
-
@rusty1s @rfdavid |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have got a matrix
H
that stores hyperedge information. The size ofH
is|nodes| * |nodes|
and the type of nodes is homogeneous. Each row in theH
is a hyperedge with the neighbors of a node.Hij = 1
, if the nodes are neighbors and connected in a hyperedge, 0 otherwise. Now, I want to apply attention as we do in the simple graph. How can we use this information to apply attention to this hypergraph? And how will the attention process differ if the type of nodes is homogeneous and/or heterogeneous?Beta Was this translation helpful? Give feedback.
All reactions