Link prediction questions: train-test, accuracy and prediction

You need to create a complete graph first, calculate the score on each edge and then got the inferenced graph.

Exactly

Can you show the the shape of src and pos_idx?

The problem is I already have this graph with its out of the graph embeddings. This graphs are extracted from a text, so its essencial this are real nodes with real information. Graphs used during training were annotated with this 3 types fof links, and now I would like to predict the other 2 types on new no annotated graphs. Sorry if I dont explain myself.

This is part of the problem, if a use new real graph without that type of link, pos_idx is obviously messed up:

Graphs: Graph(num_nodes={‘ent’: 122},
num_edges={(‘ent’, ‘link1’, ‘ent’): 0, (‘ent’, ‘link2’, ‘ent’): 486, (‘ent’, ‘link3’, ‘ent’): 0})

pos_idx: torch.Size([0, 1])
src: (14884,)

If i use a graph from the training set, which is annotated with those links, it looks like this:

Graph(num_nodes={‘ent’: 84},
num_edges={(‘ent’, ‘link1’, ‘ent’): 67, (‘ent’, ‘link2’, ‘ent’): 289, (‘ent’, ‘link3’, ‘ent’): 62}

pos_idx: torch.Size([67, 1])
src: (7056,)

I think here you may see its the first graph and not the second one, in which I wanna have inference, being it a real graph from real text with real embeddings I need to use. Problem is, as said, that this new graphs doesnt include any initial link of those types (links 1 and 3), so I dont know how to calculate the score for every pair of nodes.

Thank you so much and sorry to bother.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.