Closed FeynmanDNA closed 2 years ago
Hmm, I just realized I was confused by the edge_index
's relationship to training set again... which @jqmcginnis you have already kindly explained here (https://github.com/jocpae/VesselGraph/issues/12#issuecomment-1148524602)
So it is not surprising that the training set contains isolated nodes (like node 14 and 16 in the above example), since they are randomly chosen to be part of training or not.
@FeynmanDNA sorry once again for the late response!
Thank you very much for the observation! Do you see any intuitive way of handling this to a better extent? I am still not very happy with the terminology of edge_index, edge_index_undirected and the training, validation and test masks. Do you see anyway of handling this in a better way, or should we stick to it for now?
@jqmcginnis like you mentioned in your code comment that the link dataset adheres to the convention that only training edges are present in the data.edge_index.
I recommend sticking to the community convention :)
Strangely even though
print(f'Contains isolated nodes: {data.contains_isolated_nodes()}')
returnsTrue
, the networkx converted graph reports no sub-graphs:nx.number_connected_components(G) == 1
Then I looked into the difference between
edge_index
andedge_index_undirected
and noticed some discrepancy.Python code to reproduce my observation:
Note that
edge_index
reports no edge for node14
and16
, butedge_index_undirected
somehow returns edges that involves node 14 and 16In fact, after the networkx conversion, if like
data.contains_isolated_nodes()
said, it has isolated nodes, then we should see subgraphs of connected components, but strangely we get a singe graph:I tried
remove_isolated_nodes
and it reports similar observations.Looks like
edge_index_undirected
is custom-made, maybe there is some logic that connects isolated nodes somehow that users should be be aware of?Thanks!