New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Learning the graph structure ? #39
Comments
The first thing that comes to mind is using a k-nn graph. (https://pytorch-geometric.readthedocs.io/en/latest/modules/transforms.html#torch_geometric.transforms.KNNGraph) However, this method may produce suboptimal edges, and SuperGAT does not fundamentally correct them. Would you like to take a look at the papers below?
Yes. Many GNN models, as well as GATs, require edges. The case where there is no edge in the graph seems to be a special case. It would be good to look for set representation learning.
If you apply the GAT for all possible pairs of edges (|V|x|V|), mathematically this is equivalent to the Transformer. See https://graphdeeplearning.github.io/post/transformers-are-gnns/ In general, it is difficult to answer which one will do better. I first need to see datasets and understand actual use cases.
SuperGAT doesn't seem appropriate for a graph that considers all |V|x|V| edge spaces. In this case, negative sampling, a key design in SuperGAT, might not be well defined (this is also described in the paper). If you give a little more context about your application, I can be of more help. |
Thank so much for this wealth of information.
I am trying methods that the corresponding keypoints in two images. Similar methods are such as (a) Superglue: learning feature matching with graph neural networks and (b) LoFTR: Detector-Free Local Feature Matching with Transformers.... When I looked carefully, I found that these two methods do not really focus on the edges of the GAT (the graph structure is not used), as you mentioned their design seems to be based on using a transformer where GAT is used to compute attention. .. Could you advise what is the main difference between Transformer and GAT, especially why the GAT normally needs the edges and why the transformer can work without the edges? |
I just skimmed two papers. Both the problem and models are interesting but note that I am not familiar with them. Using SuperGAT to cross attention between images makes sense, but I think there should be a rigorous study about negative sampling. Looking at Figure 4 of SuperGlue, it can be seen that keypoint matching is affected not only by the one point but also by several points around them. How to properly exclude them, that is how to extract negative edges, is not straightforward.
I think that the link I posted above has already explained well. The point is that Transformers use the fully connected edges between entities, thus you can use them to no-edge-graphs. Next question is, why GATs compute attention over edges only? That is because leveraging edges usually gives more information to models. A further assumption that GATs have against Transformers is that message-passing is more useful when you use entities connected by edges rather than all entities. |
You have given me lots of understanding..... Thanks so much. Yes, I think so that the negative edges in those works are not well extracted or interpreted... I will close the issue. It has always been great to learn from you. :) |
I am really glad to hear you say so. Thank you for your attention. :) |
Hi, I am working on the application of classification/link prediction. So, far I have looked at the code such as SuperGAT. I have noticed is that the dataset used in SuperGAT (e.g., Citations) seems to already have the graph structure (the set of edges to be considered in training and testing).
However, in my application, all I have is the data attributes .....without the edges or adjacent matrix or mask to identify which nodes may be connected to which.
My questions are
The text was updated successfully, but these errors were encountered: