Coder Social home page Coder Social logo

gtrick's Introduction

gtrick: Bag of Tricks for Graph Neural Networks.

gtrick is an easy-to-use Python package collecting tricks for Graph Neural Networks. It tests and provides powerful tricks to boost your models' performance.

Trick is all you need! (English Document | 中文介绍)

Library Highlights

  • Easy-to-use: All it takes is to add a few lines of code to apply a powerful trick, with as little changes of existing code as possible.
  • Verified Trick: All tricks implemented in gtrick are tested on our selected datasets. Only the tricks indeed improving model's performance can be collected by gtrick.
  • Backend Free: We provide all tricks both in DGL and PyG. Whatever graph learning library you use, feel free to try it.

Installation

Note: This is a developmental release.

pip install gtrick

Quick Start

It is very easy to get start with gtrick. You can enhance your GNN model with only a few lines of code.

quickstart

For more detailed examples, see Example in Trick.

Trick

Trick Example Task Reference
VirtualNode DGL
PyG
graph OGB Graph Property Prediction Examples
FLAG DGL
PyG
node*
graph
Robust Optimization as Data Augmentation for Large-scale Graphs
Fingerprint DGL
PyG
molecular graph* Extended-Connectivity Fingerprints
Random Feature DGL
PyG
graph* Random Features Strengthen Graph Neural Networks
Label Propagation DGL
PyG
node* Learning from Labeled and Unlabeled Datawith Label Propagation
Correct & Smooth DGL
PyG
node* Combining Label Propagation And Simple Models Out-performs Graph Neural Networks
Common Neighbors DGL
PyG
link* Link Prediction with Structural Information
Resource Allocation DGL
PyG
link* Link Prediction with Structural Information
Adamic Adar DGL
PyG
link* Link Prediction with Structural Information
Anchor Distance DGL
PyG
link* Link Prediction with Structural Information

We have tested all these tricks on selected datasets, you can find the benchmark in PyG Benchmark and DGL Benchmark.

Contributing

Please let me know if you encounter a bug or have any suggestions by filing an issue.

I welcome all contributions from bug fixes, new tricks and better examples.

There are also some trciks I'm planning to add, feel free to implement one of them for gtrick:

gtrick's People

Contributors

sangyx avatar wey-gu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gtrick's Issues

Is the dimension of h and vx output by the 'update_node_emb' method in the 'VirtualNode' class consistent?

Hello, may I ask if the dimensions of h and vx output by the 'update_node_emb' method are the same? From the code perspective, it should be the same, but what I actually run is different. The number of lines in h is the same as the number of nodes, but the number of lines in vx is the same as "batch_size". Finally, it seems that due to the inconsistent dimensions of h and vx, the statement 'global_add_pool (x, batch)+vx' in the 'update_vn_emb' method reported an error.
The error reported is

RuntimeError: The size of tensor a (37) must match the size of tensor b (128) at non-singleton dimension 1

why should not use x += perturb

Hi, thanks for your work. In FLAG.py, you comment 'add perturb to x, note that do not use x += perturb' in line 65. And I want to know why should not use x += perturb.

why

边特征提示AttributeError: type object 'SparseTensor' has no attribute 'from_edge_index'

Question about VirtualNode

I want to add a virtual node to the graph, but I don't want to connect the whole graph, just some nodes in it. How should I do this?
For example: there is a node V={0,1,2,3,4} in the graph, I want to add a node s, connect {s,0},{s,2}, how to realise this is relatively simple.

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.