Code Monkey home page Code Monkey logo

graph-learning's Introduction

图模型实践

图模型项目(GCN、GAT、GraphSAGE、deepwalk、node2vec)细节实践、论文复现、持续更新、欢迎star、交流学习。

1. 环境准备

based on dgl and pytorch mainly

pip install -r requirements.txt

2. 数据

download dataset,put it to ./data/

uploaded dataset blog already

3. 图模型代码详解:

Notes of model written here:

  1. 游走图模型--同构图DeepWalk解析
  2. 游走图模型-聊聊Node2Vec
  3. 图卷积:从GCN到GAT、GraphSAGE
  4. 怎么搭一个GCN?只需这四步
  5. 怎么搭好一个GraphSAGE?按这三步走
  6. Link-Prediction:搭一个无监督的GraphSAGE

How to run

DeepWalk

①. How to run deepwalk model for graph embedding?

cd deepwalk
python main.py

②. node classification task

python node_classification.py

Node2Vec

①. How to run Node2Vec model

cd node2vec
python main.py

②. node classification task(should chang the checkpoint of node2vec in node_classification.py).

python node_classification.py

GCN

①. How to run GCN model

python train.py

Cora dataset node classification(cora dataset will be download in ~/.dgl/ automatically).
Test accuracy ~0.806 (0.793-0.819) (paper: 0.815).

GraphSAGE
Node Classification

①. How to run GraphSAGE model

cd graphsage/node_classification
python train.py

Cora dataset node classification(cora dataset will be download in ~/.dgl/ automatically).
Test accuracy ~0.781(0.762-0.801) (paper: 0.815).

Link Prediction

①. How to run GraphSAGE model

cd graphsage/link_prediction
python train.py

Test F1: 0.630 (0.6120.648) (cora数据集)

GAT

①. How to run GAT model

python train.py

Cora dataset node classification(cora dataset will be download in ~/.dgl/ automatically).
Test accuracy ~0.810 (0.792-0.820) (paper: 0.830).

graph-learning's People

Contributors

shuxinyin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.