DeepGraphLearning / ULTRA

A foundation model for knowledge graph reasoning
MIT License
439 stars 59 forks source link

How to define what will be predicted #18

Closed vsthiago closed 5 months ago

vsthiago commented 5 months ago

I didn't understand how to define the target triples that will be predicted. Could you enlighten me on this?

migalkin commented 5 months ago

Triples to be predicted are stored in the PyG valid/test data object under target_edge_index and target_edge_type. For example, in transductive FB15k237 they are stored like this:

https://github.com/DeepGraphLearning/ULTRA/blob/c414f83d9ec1e4726f396c24beab6311a2869f1a/ultra/datasets.py#L192-L197

And for inductive Grail datasets like this:

https://github.com/DeepGraphLearning/ULTRA/blob/c414f83d9ec1e4726f396c24beab6311a2869f1a/ultra/datasets.py#L126-L129

During evaluation, we create a dataloader from them and loop through the triples

https://github.com/DeepGraphLearning/ULTRA/blob/c414f83d9ec1e4726f396c24beab6311a2869f1a/script/run.py#L126-L128