All Projects → EdisonLeeeee → Graphgallery

EdisonLeeeee / Graphgallery

Licence: mit
GraphGallery is a gallery for benchmarking Graph Neural Networks (GNNs) and Graph Adversarial Learning with TensorFlow 2.x and PyTorch backend.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Graphgallery

Libgrape Lite
🍇 A C++ library for parallel graph processing 🍇
Stars: ✭ 169 (-9.14%)
Mutual labels:  graph
Gprof2dot
Converts profiling output to a dot graph.
Stars: ✭ 2,309 (+1141.4%)
Mutual labels:  graph
Hope
Source code of CVPR 2020 paper, "HOPE-Net: A Graph-based Model for Hand-Object Pose Estimation"
Stars: ✭ 184 (-1.08%)
Mutual labels:  graph
Programming Languages Influence
Code to retrieve data for the programming languages influence visualizations from Freebase
Stars: ✭ 171 (-8.06%)
Mutual labels:  graph
Geneweb
GeneWeb is an open source genealogy software with a web interface created by Daniel de Rauglaudre.
Stars: ✭ 171 (-8.06%)
Mutual labels:  graph
Leetcode
High-quality LeetCode solutions
Stars: ✭ 178 (-4.3%)
Mutual labels:  graph
Awesome Gnn Recommendation
Graph Neural Network
Stars: ✭ 168 (-9.68%)
Mutual labels:  graph
Graph attention pool
Attention over nodes in Graph Neural Networks using PyTorch (NeurIPS 2019)
Stars: ✭ 186 (+0%)
Mutual labels:  graph
Graphic
A Flutter data visualization library based on Grammar of Graphics.
Stars: ✭ 173 (-6.99%)
Mutual labels:  graph
Kahip
KaHIP -- Karlsruhe HIGH Quality Partitioning.
Stars: ✭ 180 (-3.23%)
Mutual labels:  graph
Stateful
Finite state machine for Go
Stars: ✭ 172 (-7.53%)
Mutual labels:  graph
J2team Community
Join our group to see more
Stars: ✭ 172 (-7.53%)
Mutual labels:  graph
Unity Easinglibraryvisualisation
Front end visualisation of 40 common easing equations.
Stars: ✭ 178 (-4.3%)
Mutual labels:  graph
Amazon Sde Test Series
This repository includes all the interview preparation questions for Amazon SDE role
Stars: ✭ 167 (-10.22%)
Mutual labels:  graph
Sparkliner
Sparkliner — easy way to make sparkline graph [Sketch plugin]
Stars: ✭ 184 (-1.08%)
Mutual labels:  graph
Relation Graph
Vue 关联关系图谱组件,可以展示如组织机构图谱、股权架构图谱、集团关系图谱等知识图谱,可提供多种图谱布局,包括树状布局、中心布局、力学布局自动布局等。Vue component for relationship graph , which can display knowledge graphs, such as organization graph, equity structure graph, group relationship graph,
Stars: ✭ 166 (-10.75%)
Mutual labels:  graph
Rosmaro
Visual automata-based programming in functional JavaScript
Stars: ✭ 176 (-5.38%)
Mutual labels:  graph
Gun
An open source cybersecurity protocol for syncing decentralized graph data.
Stars: ✭ 15,172 (+8056.99%)
Mutual labels:  graph
Unipop
Data Integration Graph
Stars: ✭ 184 (-1.08%)
Mutual labels:  graph
Veranda
A graph editor framework for Unity
Stars: ✭ 180 (-3.23%)
Mutual labels:  graph

logo

TensorFLow or PyTorch? Both!

Python tensorflow pytorch pypi license

GraphGallery

GraphGallery is a gallery for benchmarking Graph Neural Networks (GNNs) and Graph Adversarial Learning with TensorFlow 2.x and PyTorch backend. Besides, Pytorch Geometric (PyG) backend and Deep Graph Library (DGL) backend now are available in GraphGallery.

💨 NEWS

We have integrated the Adversarial Attacks in this project, examples please refer to Graph Adversarial Learning examples.

🚀 Installation

pip install -U graphgallery

or

https://github.com/EdisonLeeeee/GraphGallery.git
cd GraphGallery
pip install -e .

GraphGallery has been tested on:

  • CPU, CUDA 10.1, CUDA 11.0
  • TensorFlow 2.1~2.4, 2.1.2 is recommended.
  • PyTorch 1.4~1.7
  • Pytorch Geometric (PyG) 1.6.1
  • DGL 0.5.2, 0.5.3

🤖 Implementations

Please refer to the examples directory. (The examples are updating...)

⚡ Quick Start on GNNs

Datasets

more details please refer to GraphData.

Example of GCN

from graphgallery.gallery import GCN

# initialize a GNN trainer
trainer = GCN(graph)
# process your inputs, such as converting to tensors
trainer.process()
# build your GCN trainer with default hyper-parameters
trainer.build()
# train your trainer. here splits.train_nodes and splits.val_nodes are numpy arrays
# verbose takes 0, 1, 2, 3, 4
history = trainer.train(splits.train_nodes, splits.val_nodes, verbose=1, epochs=100)
# test your trainer
# verbose takes 0, 1, 2
results = trainer.test(splits.nodes, verbose=1)
print(f'Test loss {results.loss:.5}, Test accuracy {results.accuracy:.2%}')

Other models in the gallery are the same.

Using Other Backend

>>> import graphgallery
>>> graphgallery.backend()
TensorFlow 2.1.2 Backend

>>> graphgallery.set_backend("pytorch")
PyTorch 1.6.0+cu101 Backend

# DGL PyTorch backend
>>> graphgallery.set_backend("dgl")

# DGL TensorFlow backend
>>> graphgallery.set_backend("dgl-tf")

But your codes don't even need to change.

❓ How to add your datasets

This is motivated by gnn-benchmark

from graphgallery.data import Graph

# Load the adjacency matrix A, attribute matrix X and labels vector y
# A - scipy.sparse.csr_matrix of shape [num_nodes, num_nodes]
# X - scipy.sparse.csr_matrix or np.ndarray of shape [num_nodes, num_attrs]
# y - np.ndarray of shape [num_nodes]

mydataset = Graph(adj_matrix=A, node_attr=X, node_label=y)
# save dataset
mydataset.to_npz('path/to/mydataset.npz')
# load dataset
mydataset = Graph.from_npz('path/to/mydataset.npz')

⭐ Road Map

  • [x] Add PyTorch trainers support
  • [x] Add other frameworks (PyG and DGL) support
  • [ ] Add more GNN trainers (TF and Torch backend)
  • [ ] Support for more tasks, e.g., graph Classification and link prediction
  • [x] Support for more types of graphs, e.g., Heterogeneous graph
  • [ ] Add Docstrings and Documentation (Building)
  • [ ] Comprehensive tutorials

😘 Acknowledgement

This project is motivated by Pytorch Geometric, Tensorflow Geometric, Stellargraph and DGL, etc., and the original implementations of the authors, thanks for their excellent works!

Cite

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].