tkipf / gcn

Implementation of Graph Convolutional Networks in TensorFlow
MIT License
7.08k stars 1.99k forks source link

can gcn predict the unseen nodes? #103

Open Ye-D opened 5 years ago

Ye-D commented 5 years ago

Hi, If I trained a gcn model,can I use it to generate embeddings to unseen nodes,which are not included in the matrix A? Thank you very much

tkipf commented 5 years ago

Yes!

On Mon 8. Apr 2019 at 11:20 Ye D. notifications@github.com wrote:

Hi, If I trained a gcn model,can I use it to generate embeddings to unseen nodes,which are not included in the matrix A? Thank you very much

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tkipf/gcn/issues/103, or mute the thread https://github.com/notifications/unsubscribe-auth/AHAcYKpM-MLfTir2HdpOzGhrAomGdGkgks5vewnggaJpZM4chskv .

Ye-D commented 5 years ago

Yes! On Mon 8. Apr 2019 at 11:20 Ye D. @.***> wrote: Hi, If I trained a gcn model,can I use it to generate embeddings to unseen nodes,which are not included in the matrix A? Thank you very much — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#103>, or mute the thread https://github.com/notifications/unsubscribe-auth/AHAcYKpM-MLfTir2HdpOzGhrAomGdGkgks5vewnggaJpZM4chskv .

Then, I cannot find out how to do the prediction. Because I didn't have the new node x in the train phase,the Matrix A didn't contain x's adjacent information. When I want to generate the embedding for it , I can only provide x's feature vector to the model whose A doesn't contain x's information. Can I get the right prediction for x ? Thank you very much.

tkipf commented 5 years ago

The adjacency matrix you provide during training can be different from the adjacency matrix provided at test time. You can make a prediction for a new data point by respectively updating the adjacency matrix (adding all the links of the new data point to existing data points) and by appending the new node's feature vector to the node feature matrix X.

On Mon, Apr 8, 2019 at 1:38 PM Ye D. notifications@github.com wrote:

Yes! … <#m1817928073106379103> On Mon 8. Apr 2019 at 11:20 Ye D. @.***> wrote: Hi, If I trained a gcn model,can I use it to generate embeddings to unseen nodes,which are not included in the matrix A? Thank you very much — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#103 https://github.com/tkipf/gcn/issues/103>, or mute the thread https://github.com/notifications/unsubscribe-auth/AHAcYKpM-MLfTir2HdpOzGhrAomGdGkgks5vewnggaJpZM4chskv .

Then, I cannot find out how to do the prediction. Because I didn't have the new node x in the train phase,the Matrix A didn't contain x's adjacent information. When I want to generate the embedding for it , I can only provide x's feature vector to the model whose A doesn't contain x's information. Can I get the right prediction for x ? Thank you very much.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tkipf/gcn/issues/103#issuecomment-480796061, or mute the thread https://github.com/notifications/unsubscribe-auth/AHAcYAZEq7ZwCYCMWOzue3JFCwOv5fpQks5veypBgaJpZM4chskv .

crystal0913 commented 5 years ago

Does the dimension match of trained weight W and feature matrix after appending the new node's feature vector ? the dimension of new feature matrix X is (n+1, n+1) while origin is (n, n), it's right?

tkipf commented 5 years ago

Dimensions need to match if you do not re-train the model.

On Mon, May 6, 2019 at 1:39 PM crystal0913 notifications@github.com wrote:

Does the dimension match of trained weight W and feature matrix after appending the new node's feature vector ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tkipf/gcn/issues/103#issuecomment-489590693, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYBYYC4RMKPLMKAX7KX3XTPUAKITANCNFSM4HEGZEXQ .

tongcu commented 5 years ago

Dimensions need to match if you do not re-train the model. On Mon, May 6, 2019 at 1:39 PM crystal0913 @.***> wrote: Does the dimension match of trained weight W and feature matrix after appending the new node's feature vector ? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#103 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYBYYC4RMKPLMKAX7KX3XTPUAKITANCNFSM4HEGZEXQ .

Here,I have two questions, Q1. If i apply the a batch of data/subnetworks to iteratively train the GCN and use the trained network to predict new data.
Is this training plan reasonable?

Q2. Why we need the masked loss in GCN?

jc7723 commented 4 years ago

Dimensions need to match if you do not re-train the model. On Mon, May 6, 2019 at 1:39 PM crystal0913 @.***> wrote: Does the dimension match of trained weight W and feature matrix after appending the new node's feature vector ? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#103 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABYBYYC4RMKPLMKAX7KX3XTPUAKITANCNFSM4HEGZEXQ .

How can new nodes being put into the graph with its dimensions unchanged? Or we just replace "man-made fake isolated nodes" with new nodes?

shivam1702 commented 4 years ago

How did you solve this? By using some fake nodes while training and then filling their feature vectors with relevant data and their adjacency with the relevant nodes?

xxxxxxxxzq commented 3 years ago

请问您解决这个问题了吗,是怎么解决的

vijay2411 commented 3 years ago

Maybe we can apply gcn on top of deepwalk from where we can obtain a d dimensional graph embedding which can be used as input as C features in this model. Then it can be used in an inductive manner. But since deepwalk itself is transductive, it doesn't helps. As per discussions over here, I don't think original gcn can be extended inductively in a unsupervised or semi-supervised clustering problems. If someone can find something useful in this matter, it would be great help. Thank You

qqfox commented 2 years ago

Halo, is there anyone find solutions for this issue? I have tried several ways but none worked. thanks