gammagl.layers.conv.GPRConv¶
- class GPRConv(K, alpha, Init='PPR', Gamma=None, **kwargs)[source]¶
The graph propagation oeprator from the “Adaptive Universal Generalized PageRank Graph Neural Network” paper
\[\begin{split}\mathbf{H}^{(k)} = \mathbf{\hat{D}}^{-1/2} \mathbf{\hat{A}} \mathbf{\hat{D}}^{-1/2} \mathbf{H}^{(k-1)} \\ \mathbf{Z} = \sum\limits_{k=0}^{k=K}\gamma_k\mathbf{H}^{(k)}.\end{split}\]where \(\mathbf{\hat{A}} = \mathbf{A} + \mathbf{I}\) denotes the adjacency matrix with inserted self-loops and \(\hat{D}_{ii} = \sum_{j=0} \hat{A}_{ij}\) its diagonal degree matrix. The adjacency matrix can include other values than
1representing edge weights via the optionaledge_weighttensor. \(\gamma_{k}\) its learnt weights.- Parameters:
k – steps to propagate.
alpha – assgin initial value to learnt weights, used in concert with Init.
Init – initialization method(SGC, PPR, NPPR, Random, WS).
- forward(x, edge_index, edge_weight=None, num_nodes=None)[source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.