前言
大家好,我是阿光。
本專欄整理了《圖神經(jīng)網(wǎng)絡(luò)代碼實(shí)戰(zhàn)》,內(nèi)包含了不同圖神經(jīng)網(wǎng)絡(luò)的相關(guān)代碼實(shí)現(xiàn)(PyG以及自實(shí)現(xiàn)),理論與實(shí)踐相結(jié)合,如GCN、GAT、GraphSAGE等經(jīng)典圖網(wǎng)絡(luò),每一個(gè)代碼實(shí)例都附帶有完整的代碼。
正在更新中~ ?
[圖片上傳失敗...(image-ea3e56-1675240362428)]
?? 我的項(xiàng)目環(huán)境:
- 平臺(tái):Windows10
- 語(yǔ)言環(huán)境:python3.7
- 編譯器:PyCharm
- PyTorch版本:1.11.0
- PyG版本:2.1.0
?? 『精品學(xué)習(xí)專欄導(dǎo)航帖』
??<font color=Tomato>【Matplotlib繪制圖像目錄】Python數(shù)據(jù)可視化之美??
??<font color=Sienna>【Pandas數(shù)據(jù)處理100例目錄】Python數(shù)據(jù)分析玩轉(zhuǎn)Excel表格數(shù)據(jù)??
??<font color=red>最適合入門的100個(gè)深度學(xué)習(xí)實(shí)戰(zhàn)項(xiàng)目??
??<font color=gold>【機(jī)器學(xué)習(xí)入門項(xiàng)目10例目錄】項(xiàng)目詳解 + 數(shù)據(jù)集 + 完整源碼??
??<font color=green>【機(jī)器學(xué)習(xí)項(xiàng)目實(shí)戰(zhàn)10例目錄】項(xiàng)目詳解 + 數(shù)據(jù)集 + 完整源碼??
??<font color=deepskyblue>【2023王道數(shù)據(jù)結(jié)構(gòu)目錄】課后算法設(shè)計(jì)題C、C++代碼實(shí)現(xiàn)完整版大全??
對(duì)于本專欄的網(wǎng)絡(luò)模型,分別使用了三種實(shí)現(xiàn)方式 PyG框架實(shí)現(xiàn)、PyTorch實(shí)現(xiàn)、Message Passing消息傳遞機(jī)制實(shí)現(xiàn),小伙伴可以按照自己的能力以及需求學(xué)習(xí)不同的實(shí)現(xiàn)方式。
注意 ??:本目錄中已存在的鏈接博文已全部寫好,例如 + (一):節(jié)點(diǎn)分類 這類帶有刪除線的文章表示正在更新中,如果寫完會(huì)去掉刪除線,點(diǎn)擊出現(xiàn)404表示文章還沒(méi)有發(fā)布,后續(xù)根據(jù)情況陸續(xù)發(fā)布。
??『目錄』
?? PyG算子、數(shù)據(jù)集介紹
?? 圖神經(jīng)網(wǎng)絡(luò)常見(jiàn)任務(wù)與應(yīng)用場(chǎng)景
- (一):節(jié)點(diǎn)分類(PyG基于GCN實(shí)現(xiàn)Cora節(jié)點(diǎn)分類任務(wù))
-
(二):圖分類(PyG基于GCN實(shí)現(xiàn)MUTAG圖分類任務(wù))
+ (三):鏈路預(yù)測(cè)
+ (四):異常檢測(cè)
+ (五):社區(qū)檢測(cè)
?? 圖嵌入學(xué)習(xí)(Graph Embedding)
+ (一):DeepWalk
+ (二):Node2Vec
+ (三):LINE
?? 圖池化(Graph Pooling)
+ (一):Node Selection
+ (二):Graph Coarsening
+ (三):Hard Rule
?? MLP
- (一):Pytorch+PyG實(shí)現(xiàn)MLP(基于PyG實(shí)現(xiàn))
- (二):Pytorch實(shí)現(xiàn)MLP(基于PyTorch實(shí)現(xiàn))
?? GCN
- (一):Pytorch+PyG實(shí)現(xiàn)GCN(基于PyG實(shí)現(xiàn))
- (二):Pytorch實(shí)現(xiàn)GCN(基于PyTorch實(shí)現(xiàn))
- (三):Pytorch實(shí)現(xiàn)GCN(基于Message Passing消息傳遞機(jī)制實(shí)現(xiàn))
?? GAT
- (一):Pytorch+PyG實(shí)現(xiàn)GAT(基于PyG實(shí)現(xiàn))
- (二):Pytorch實(shí)現(xiàn)GAT(基于PyTorch實(shí)現(xiàn))
- (三):Pytorch實(shí)現(xiàn)GAT(基于Message Passing消息傳遞機(jī)制實(shí)現(xiàn))
?? GIN
- (一):Pytorch+PyG實(shí)現(xiàn)GIN(基于PyG實(shí)現(xiàn))
- (二):Pytorch實(shí)現(xiàn)GIN(基于PyTorch實(shí)現(xiàn))
- (三):Pytorch實(shí)現(xiàn)GIN(基于Message Passing消息傳遞機(jī)制實(shí)現(xiàn))
?? GraphSAGE
- (一):Pytorch+PyG實(shí)現(xiàn)GraphSAGE(基于PyG實(shí)現(xiàn))
- (二):Pytorch實(shí)現(xiàn)GraphSAGE(基于PyTorch實(shí)現(xiàn))
- (三):Pytorch實(shí)現(xiàn)GraphSAGE(基于Message Passing消息傳遞機(jī)制實(shí)現(xiàn))
?? EdgeCNN
- (一):Pytorch+PyG實(shí)現(xiàn)EdgeCNN(基于PyG實(shí)現(xiàn))
- (二):Pytorch實(shí)現(xiàn)EdgeCNN(基于PyTorch實(shí)現(xiàn))
- (三):Pytorch實(shí)現(xiàn)EdgeCNN(基于Message Passing消息傳遞機(jī)制實(shí)現(xiàn))
?? GraphConv
- (一):Pytorch+PyG實(shí)現(xiàn)GraphConv(基于PyG實(shí)現(xiàn))
- (二):Pytorch實(shí)現(xiàn)GraphConv(基于PyTorch實(shí)現(xiàn))
- (三):Pytorch實(shí)現(xiàn)GraphConv(基于Message Passing消息傳遞機(jī)制實(shí)現(xiàn))
注意??:所有文章使用的圖數(shù)據(jù)是經(jīng)典的 Cora 數(shù)據(jù)集,定義的訓(xùn)練輪數(shù)(200輪)以及損失函數(shù)優(yōu)化器都是一致的,由于圖網(wǎng)絡(luò)很容易過(guò)擬合導(dǎo)致訓(xùn)練集的分類精度達(dá)到 99.9%,所以下表中顯示的數(shù)據(jù)都是基于測(cè)試集的。
| Accuracy | Loss | |
|---|---|---|
| MLP | 0.1800 | 1.9587 |
| GCN | 0.7200 | 1.3561 |
| GAT | 0.7810 | 1.0362 |
| GIN | 0.7650 | 0.9645 |
| GraphSAGE | 0.7060 | 1.2712 |
| EdgeCNN | 0.3790 | 1.7529 |
| GraphConv | 0.6030 | 1.2378 |