- class DegreeScalerAggregation(aggr: Union[str, List[str], Aggregation], scaler: Union[str, List[str]], deg: Tensor, train_norm: bool = False, aggr_kwargs: Optional[List[Dict[str, Any]]] = None)
Combines one or more aggregators and transforms its output with one or more scalers as introduced in the “Principal Neighbourhood Aggregation for Graph Nets” paper. The scalers are normalised by the in-degree of the training set and so must be provided at time of construction. See
torch_geometric.nn.conv.PNAConvfor more information.
deg (Tensor) – Histogram of in-degrees of nodes in the training set, used by scalers to normalize.
Resets all learnable parameters of the module.
- forward(x: Tensor, index: Optional[Tensor] = None, ptr: Optional[Tensor] = None, dim_size: Optional[int] = None, dim: int = -2) Tensor
x (torch.Tensor) – The source tensor.
dim (int, optional) – The dimension in which to aggregate. (default: