torch_geometric.nn.norm.GraphSizeNorm
- class GraphSizeNorm[source]
Bases:
Module对一批节点特征中的每个单独图应用图大小归一化,如“基准测试图神经网络”论文中所述。
\[\mathbf{x}^{\prime}_i = \frac{\mathbf{x}_i}{\sqrt{|\mathcal{V}|}}\]- forward(x: Tensor, batch: Optional[Tensor] = None, batch_size: Optional[int] = None) Tensor[source]
前向传播。
- Parameters:
x (torch.Tensor) – The source tensor.
batch (torch.Tensor, optional) – 批次向量 \(\mathbf{b} \in {\{ 0, \ldots, B-1\}}^N\), 它将 每个元素分配给特定的示例。(默认值:
None)batch_size (int, optional) – The number of examples \(B\). Automatically calculated if not given. (default:
None)
- Return type: