A tutorial of Graph Neural Network, including PPT
and ipynb
file. We compared GNN
with machine learning method SVM
and classify neural network MLP
. And analyse the different message propagate methods
(like GCN
, mean
and sum
) and the impact of the removal ratio of edges.
教程适用场景,个人学习与组会分享。所有内容均可在main.ipynb
中获取, main.py
则将main.ipynb
所有代码汇总,PPT
导引思路。
使用torch
实现三种信息传播过程
。使用Cora
引文数据集进行实验,探索了删除边的比例
对模型分类的影响,发现删除的边的比例越多,模型表现越差,最后将退化为MLP模型所表现出来的分类性能。
-
导入数据与处理 (使用引文网络Cora数据集)。
-
SVM 进行分类任务
-
MLP 进行分类任务
-
GCN 进行分类任务
GCN 消息传播
$\hat{A} = A + I, D_{ii} = \sum_j{\hat{A}_{ij}}, Z = D^{-\frac{1}{2}} * \hat{A} * D^{-\frac{1}{2}}$
mean 消息传播
$\hat{A} = A + I, D_{ii} = \sum_j{\hat{A}_{ij}}, Z = D^{-1} * \hat{A} $
sum 消息传播
$\hat{A} = A + I, Z = \hat{A} $
-
随机删除边
- 随机丢弃边,设置为 [0.1, 0.3, 0.5, 0.7, 0.9]