Hi, I am training a GraphSAGE model using this tutorial WWW20-Hands-on-Tutorial/3_link_predict.ipynb at master · dglai/WWW20-Hands-on-Tutorial · GitHub. However, I don’t understand how inference on new nodes would work. Those nodes that are not included in the test or train set. Should the new nodes already be included in the graph ‘g’ before making inference? Can someone help.
The model predicts on the the test set in the following way:
logits = net(g, inputs)
pred = torch.sigmoid((logits[train_u] * logits[train_v]).sum(dim=1))
How can I use this on my new nodes?
Also,
node_embed = nn.Embedding(g.number_of_nodes(), 5) # Every node has an embedding of size 5.
inputs = node_embed.weight # Use the embedding weight as the node features.
nn.init.xavier_uniform_(inputs)
Does the inputs
value include information from the node features, in this case ‘club’ and ‘club_onehot’?