Closed FeynmanDNA closed 2 years ago
Hi Kay, So the number of edges is exactly double when you have a directed vs an undirected graph. This is expected. To understand the functionality of the inbuild PyG function please see: https://pytorch-geometric.readthedocs.io/en/latest/modules/utils.html?highlight=networkx#torch_geometric.utils.to_networkx
Hi @FeynmanDNA,
thank you very much for this question. The conventions are indeed a bit tricky and require some further explanation.
The pyg convention for link prediction tasks is to keep all training edges in data.edge_index
. However, this also implies that if we convert the link dataset graph to networkx (using the pyg function), only the training edges will be present in the resulting networkx graph. I tried to clarify this by extending the test_link_graph.py script, and printing the dimensions, please see 4e14ed6.
Does this clarify it? Looking forward to your feedback!
Cheers, Julian
Hi i think you comments in the code are very helpful! :)
Hi, I used the synthetic vessel graph and depending on before and after I convert it to networkx graph and whether it is set
to_undirected=True
, the number of edges change:This is the vessel graph as PyG dataset:
Then when I print the PyG dataset number of edges:
The number of edges is 6388 vs when I convert it to networkx:
Why is the number of edges keep changing?