torch_geometric.transforms.GDC
- class GDC(self_loop_weight: float = 1.0, normalization_in: str = 'sym', normalization_out: str = 'col', diffusion_kwargs: Dict[str, Any] = {'alpha': 0.15, 'method': 'ppr'}, sparsification_kwargs: Dict[str, Any] = {'avg_degree': 64, 'method': 'threshold'}, exact: bool = True)[源代码]
基础类:
BaseTransform通过“扩散改进图学习”论文中的图扩散卷积(GDC)处理图(功能名称:
gdc)。注意
本文提供了关于如何选择超参数的额外建议。 有关使用GCN与GDC的示例,请参见examples/gcn.py。
- Parameters:
self_loop_weight (float, optional) – 添加的自环的权重。 设置为
None以不添加自环。(默认值:1)normalization_in (str, 可选) – 原始(输入)图上转移矩阵的归一化。可能的取值:
"sym","col", 和"row"。 详情请参见GDC.transition_matrix()。 (默认值:"sym")normalization_out (str, optional) – 转换后的GDC(输出)图上的转移矩阵的归一化。可能的值为:
"sym","col","row", 和None. 详情请参见GDC.transition_matrix()。 (默认值:"col")diffusion_kwargs (dict, optional) – 包含扩散参数的字典。 method 指定扩散方法 (
"ppr","heat"或"coeff")。 每种扩散方法需要不同的额外参数。 详情请参见GDC.diffusion_matrix_exact()或GDC.diffusion_matrix_approx()。 (默认:dict(method='ppr', alpha=0.15))sparsification_kwargs (dict, optional) – 包含稀疏化参数的字典。 method 指定稀疏化方法 (
"threshold"或"topk")。 每种稀疏化方法需要不同的附加参数。 详情请参见GDC.sparsify_dense()。 (默认值:dict(method='threshold', avg_degree=64))exact (bool, optional) – 是否精确计算扩散矩阵。 请注意,精确变体不可扩展。 它们会将邻接矩阵密集化,并计算其逆矩阵或矩阵指数。 然而,近似变体不支持边权重,并且目前仅实现了个性化PageRank和通过阈值稀疏化的快速近似版本。 (默认值:
True)
- Return type: