pyg_spectral.transforms

class GenNorm(left: float, right: float | None = None, dtype: dtype = torch.float32)[source]

Bases: BaseTransform

Generalized graph normalization.

\[\mathbf{\hat{A}} = \mathbf{\hat{D}}^{-a} (\mathbf{A} + \mathbf{I}) \mathbf{\hat{D}}^{-b}\]

where \(\hat{D}_{ii} = \sum_{j=0} \hat{A}_{ij} + 1\) and \(a,b \in [0,1]\).

Parameters:
  • left (float) – left (row) normalization \(a\).

  • right (float | None, default: None) – right (col) normalization \(b\). Default to \(1-a\).

forward(data: Data) Data[source]
_abc_impl = <_abc._abc_data object>