torch_geometric.transforms.GCNNorm

class GCNNorm(add_self_loops: bool = True)[source]

Bases: BaseTransform

Applies the GCN normalization from the “Semi-supervised Classification with Graph Convolutional Networks” paper (functional name: gcn_norm).

\[\mathbf{\hat{A}} = \mathbf{\hat{D}}^{-1/2} (\mathbf{A} + \mathbf{I}) \mathbf{\hat{D}}^{-1/2}\]

where \(\hat{D}_{ii} = \sum_{j=0} \hat{A}_{ij} + 1\).