My graph has multiple labels and relationships and I want to use the graphSage algorithm. For DGL-KE, the documentation says it’s for large-scale heterograph, but it seems it doesn’t have the graphSage implementation. For my large graph, can I use DGL-KE or the regular DGL which have existing implementation of graphSage algorithm?
Hi,
KE is different from GNN. We also have Distributed DGL for large graph, is this what you are looking for?
How is GNN different from knowledge graph in terms of graph algorithm applications? Is a heterograph with different node attributes different from a knowledge graph? Specifically, the node embedding algorithm graphSage can’t be applied to knowledge graph? Thanks for clarification.
Hi, there are a couple of high-level similarity and differences. The survey paper describes them nicely. Here, I only give some of my opinions:
- GNN v.s. KE: GNN is based on message passing while KE does not aggregate neighbor information. My analogy will be that KE is a type of more shallow models while GNN is deeper and can capture high-order information.
- Heterogeneous graph v.s. knowledge graph: In terms of data representation, I will say knowledge graph is a special case of heterogeneous graph, where there is only one node type (i.e., entity) and many edge types (i.e., relations), but one can certainly extend the definition of knowledge graph to have different node types.
Following the above categorization, DGL-KE is a package designed specifically for KE algorithms (e.g., TransE) on knowledge graph, while GraphSAGE is a type of GNN for homogeneous graph. You cannot directly apply GraphSAGE on knowledge graph. To do so, please check out our user guide on Link Prediction and pay attention to the heterogeneous graph section.
Hi, Minjie:
Thanks for the information and the pointers. On Chapter 5 5.1 Node Classification/Regression — DGL 0.7.1 documentation, for these two classes:
dglnn.SAGEConv
dgl.nn.HeteroGraphConv
SAGEConv is for monograph, and the HeteroGraphConv is an implementation of heterograph for GraphSage? And the documentation example continues to say RelGraphConvLayer is for heterograph, but this implementation refers to another paper: [1703.06103] Modeling Relational Data with Graph Convolutional Networks. I do see HeteroGraphConv is used in the implementation of RelGraphConvLayer.
With that being said, if I want to train heterograph with GraphSage, should I use HeteroGraphConv or RelGraphConvLayer?
HeteroGraphConv
is more like a general wrapper for applying GNN to heterogeneous graphs. In particular, you can determine the GNN module to apply for each edge type and the way to combine the output across edge types in initializing a HeteroGraphConv
instance like in the example below.
HeteroGraphConv({
'follows' : dglnn.GraphConv(...),
'plays' : dglnn.GraphConv(...),
'sells' : dglnn.SAGEConv(...)},
aggregate='sum')
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.