torch_geometric.nn.conv.LGConv

class LGConv(normalize: bool = True, **kwargs)[source]

Bases: MessagePassing

来自“LightGCN: 简化和增强推荐系统中的图卷积网络”论文的轻量图卷积(LGC)操作符。

\[\mathbf{x}^{\prime}_i = \sum_{j \in \mathcal{N}(i)} \frac{e_{j,i}}{\sqrt{\deg(i)\deg(j)}} \mathbf{x}_j\]
Parameters:
Shapes:
  • 输入: 节点特征 \((|\mathcal{V}|, F)\), 边索引 \((2, |\mathcal{E}|)\), 边权重 \((|\mathcal{E}|)\) (可选)

  • output: node features \((|\mathcal{V}|, F)\)

forward(x: Tensor, edge_index: Union[Tensor, SparseTensor], edge_weight: Optional[Tensor] = None) Tensor[source]

运行模块的前向传播。

Return type:

Tensor

reset_parameters() None

重置模块的所有可学习参数。

Return type:

None