openhgnn.models.NARS¶
- class NARS(num_hops, args, hg)[源代码]¶
SCALABLE GRAPH NEURAL NETWORKS FOR HETEROGENEOUS GRAPHS.
Given a heterogeneous graph \(G\) and its edge relation type set \(\mathcal{R}\), our proposed method first samples \(K\) unique subsets from \(\mathcal{R}\). Then for each sampled subset \(R_i \subseteq \mathcal{R}\), we generate a relation subgraph \(G_i\) from \(G\) in which only edges whose type belongs to \(R_i\) are kept. We treat \(G_i\) as a homogeneous graph or a bipartite graph, and perform neighbor aggregation to generate \(L\)-hop neighbor features for each node. Let \(H_{v,0}\) be the input features (of dimension \(D\)) for node \(v\). For each subgraph \(G_i\) , the \(l\)-th hop features \(H_{v,l}^{i}\) are computed as
\[H_{v, l}^{i}=\sum_{u \in N_{i}(v)} \frac{1}{\left|N_{i}(v)\right|} H_{u, l-1}^{i}\]where \(N_i(v)\) is the set of neighbors of node \(v\) in \(G_i\).
For each layer \(l\), we let the model adaptively learn which relation-subgraph features to use by aggregating features from different subgraphs \(G_i\) with learnable 1-D convolution. The aggregated \(l\)-hop features across all subgraphs are calculated as
\[H_{v, l}^{a g g}=\sum_{i=1}^{K} a_{i, l} \cdot H_{v, l}^{i}\]where \(H^i\) is the neighbor averaging features on subgraph \(G_i\) and \(a_{i,l}\) is a learned vector of length equal to the feature dimension \(D\).
- 参数:
备注
We do not support the dataset without feature, (e.g. HGBn-Freebase because the model performs neighbor aggregation to generate \(L\)-hop neighbor features at once.