iMoonLab / HGNN

Hypergraph Neural Networks (AAAI 2019)
MIT License
661 stars 128 forks source link

Code for citation networks #3

Closed rra94 closed 5 years ago

rra94 commented 5 years ago

Hi Could you please include the code for the citation networks as well? Or at least the pseudocode for converting the graph to hypergraph and the hyperparameter settings.

yifanfeng97 commented 5 years ago

Hi. In this work, a simple approach is employed to convert the simple graph adjacency matrix to hypergraph incidence matrix: For the simplest one: If there is an existing graph structure. Given a simple graph edge list E, which contains tuples like (node_i, node_j) means there is a connection between node_i and node_j. And a node feature matrix F with dimension N \times C.Following the below pseudocode a hypergraph incidence matrix H can be generated. idx = 0 for node_s, node_d in E: H[idx, node_s] = 1 H[idx, node_d] = 1 idx += 1

There is an optional step that we can use the flexible extensible of the hypergraph. Here based on the above process we can also incorporate more information into the hypergraph. For each node, we can gather their K neighbor node in feature space and link them through a hyperedge. Through the strategy, we can obtain an extra hypergraph incidence matrix. After that, we concatenate them to get the final hypergraph incidence matrix H.

rra94 commented 5 years ago

Hi Yian

I implemented your code and while I get same results for cora, for pubmed I get 79.1 instead of 80.1? Can you help with that?

yifanfeng97 commented 5 years ago

Hi rra94! You can attempt to include extra information to construct extra hyperedge. Such as for each article you can build a hyperedge to link all the authors of the article. Besides, you can attempt to adjust the learning rate or embedding dimension or other hyper-parameter to achieve better performance. The hypergraph is much more flexible than the graph thanks to the flexible operation of the hypergraph incidence matrix.