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:
- _abc_impl = <_abc._abc_data object>
- class RemoveSelfLoops(attr: str = 'edge_weight') None [source]
Bases:
BaseTransform
Removes all self-loops in the given homogeneous or heterogeneous graph (functional name:
remove_self_loops
).- Parameters:
attr (
str, optional
) – The name of the attribute of edge weights or multi-dimensional edge features to pass totorch_geometric.utils.remove_self_loops()
. (default:"edge_weight"
)
- forward(data: Data | HeteroData) Data | HeteroData [source]
- _abc_impl = <_abc._abc_data object>