williamleif / GraphSAGE

Representation learning on large graphs using stochastic graph convolutions.
Other
3.43k stars 843 forks source link

how to gain embedding of new nodes #34

Open guott15 opened 6 years ago

guott15 commented 6 years ago

Hi, I want to do cross validation using the node embedding as input of a classifier, but I do not known how to gain the embedding vectors of new nodes, would you like to introduce me which your function or file have this function? Thank you very much!

RexYing commented 6 years ago

Hi,

You can run the incremental_evaluate function, which runs the already trained model on all nodes in the graph (with minimum modification you can also run on a new graph by changing the adjacency matrix). This will include the new nodes, i.e. nodes not seen during training. You can also explicitly call sess.run([model.ranks, model.mrr], feed_dict=feed_dict_val), and feed in your own batch of new nodes in the feed dict.

Best, Rex