Giter VIP home page Giter VIP logo

dgl-classify-ring's Introduction

DGL-Classify-Ring

这是一个DGL图神经库的入门例子。
使用图神经网络来分类全连接图的节点是位于内环还是外环。

This is an example of DGL graph neural library.
Graph neural network is used to classify whether the nodes of a fully connected graph are located in the inner ring or the outer ring.

有两条环状排列的节点,构造它们的全连接图,然后判断节点是属于内环还是属于外环。
输入有两个,一个是节点自身的XY坐标,一个是节点之间的关系图。
输出是一个onehot向量,只有两个结果,0或1。0代表为节点属于内环,1代表节点属于外环。
然后数据集里面,每个图的都是长这样的,但是它们的内环和外环的半径各不相同,环的中心坐标也各不相同。

There are two nodes arranged in a ring, construct their full connection graph, and then judge whether the nodes belong to the inner ring or the outer ring.
There are two inputs, one is the XY coordinate of the node itself, and the other is the relationship graph between nodes.
The output is a onehot vector with only two results, 0 or 1. 0 means that the node belongs to the inner ring, and 1 means that the node belongs to the outer ring.
Then, in the dataset, each graph is long like this, but the radii of its inner and outer rings are different, and the central coordinates of the rings are also different.

1
2
3

Dependency / 依赖库

numpy >= 1.20
networkx >= 2.5.1
imageio >= 2.9.0
matplotlib >= 3.4.2
torch >= 1.8.1
dgl >= 0.6.1

Start / 开始

非常简单,只需要克隆本仓库,使用以下命令启动即可。
内外环图数据集会自动随机生成。
网络会自动开始训练和验证。
你可以在文件夹 show_dir 中看到训练中生成的图像。

Very simple, just clone this repo and start it with the following command. The inner and outer ring graph dataset is generated automatically and randomly. The network will start training and verification automatically. You can see the images generated during training in the folder "train_show_dir".

git clone https://github.com/One-sixth/DGL-Classify-Ring
cd ./DGL-Classify-Ring
python gnn_example.py

dgl-classify-ring's People

Contributors

one-sixth avatar

Watchers

 avatar  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.