PetarV- / GAT

Graph Attention Networks (https://arxiv.org/abs/1710.10903)
https://petar-v.com/GAT/
MIT License
3.18k stars 642 forks source link

How to use GAT to generate embeddings to graph nodes #28

Open agave233 opened 5 years ago

agave233 commented 5 years ago

Hi, Petar Firstly, thanks for your great works!

I want to use GAT for link prediction, my datasets only can give the adjacency matrix as input for GAT. Node doesn't have explicit features like Cora dataset. My question is if I can generate embeddings (features) for each node of the graph, for example, can I assign a unique one-hot vector for every node as input feature?

Thanks

TranSirius commented 5 years ago

It seems that one hot input is not that appropriate. You can view each dimension as a channel and when you use one hot vector as the input feature, it would be far too sparse for information to aggregate in a single channel.

You can use row vector in Adjacency matrix as feature vector. Besides, I would suggest you to use some random walk based embedding technique to generate the initial embedding. (Node2vec etc.)