Closed sidhantls closed 2 years ago
Yes, this is actually intended. There already exists some dicussion about this, see, e.g., https://github.com/pyg-team/pytorch_geometric/discussions/3760. I just merged a check for this into master, see https://github.com/pyg-team/pytorch_geometric/pull/3775.
This is really a challenging problem to tackle. What would you expect to happen in this case? How can we update a node type during GNN propagation if it does not receive any new information?
interesting. I would actually expect it to still work because it will be a source of information to the other nodes, hence it can be still useful.
For example, even if Node type C has no edges going to it, but only edges going from it, currently it's not compatible because Node C's node type will never be updated. But it would still be able to improve the feature representations of it neighbouring nodes through message passing. So it could be better if these nodes are still connected in the graph?
@rusty1s what do you think?
Yes, I understand that this can be useful (that's why we enforce bidirectional edges in the first place). However, without these bidirectional edges, it is not clear how a isolated node type actually updates its information in layer L (since it does not receive any new information). I think the current strategy to inform the user about this is better than to fix this magically in the background (e.g., by applying a Linear
transformation on isolated node types), but I'm happy to take any alternative suggestions.
🐛 Bug
Created a directed Hetrogenous graph datadataset and hetrogenous GAT model. There is an error occuring during the forward pass when the graph dataset is modified a certain way.
When each node type in the hetrogenous graph has an edge going to and from it, there are no errors. But when some of the node types only have edges going from it, but no edge going to it, I get the below error during the forward pas
I'm suspected this has something to do with a particular key not being found in the dataset according to #1103, although this had something to do with the dataloader. I'm not sure why it wouldn't work though, when there are some nodes in the graph that have only edges going from it and none going to it.
The graph dataset where the forward pass does work looks something like this:
The graph dataset where the error does occur is this. here,there are only edges from q to a and r to a but not a to q or a to r, like the previous dataset had. This is what seems to cause the error.
Graph model used:
Any reason as to why
To Reproduce
Unable to at the moment because graph as custom created. And work on creating a similar dataset if required to be reproducible
Expected behavior
Forward pass occurs without error in both cases
Environment
torch_geometric.__version__
):2.02torch.__version__
):1.9.0+cu1023.9
):3.8conda
,pip
, source):conda