Giter Site home page Giter Site logo

qiangking / h2gcn-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from giteventhandler/h2gcn-pytorch

0.0 0.0 0.0 5.48 MB

A pytorch implementation of H2GCN raised in the paper "Beyond Homophily in Graph Neural Networks: Current Limitations and Effective Designs".

License: Mozilla Public License 2.0

Python 100.00%

h2gcn-pytorch's Introduction

H2GCN-Pytorch

This repo is a pytorch implementation of H2GCN raised in the paper "Beyond Homophily in Graph Neural Networks: Current Limitations and Effective Designs". Original tensorflow implementation can be found here.

Requirement

This project should be able to run without any modification after following packages installed.

pytorch
networkx
torch-sparse

Tutorial

Run train.py

usage: train.py [-h] [--seed SEED] [--epochs EPOCHS] [--lr LR] [--k K]
                [--wd WD] [--hidden HIDDEN] [--dropout DROPOUT]
                [--patience PATIENCE] [--dataset DATASET] [--gpu GPU]
                [--split SPLIT]

optional arguments:
  -h, --help           show this help message and exit
  --seed SEED          seed
  --epochs EPOCHS      number of epochs to train
  --lr LR              learning rate
  --k K                number of embedding rounds
  --wd WD              weight decay value
  --hidden HIDDEN      embedding output dim
  --dropout DROPOUT    dropout rate
  --patience PATIENCE  patience for early stop
  --dataset DATASET    dateset name
  --gpu GPU            gpu id to use while training, set -1 to use cpu
  --split SPLIT        data split to use

Custom dataset

All dataset used in this repo were forked from repo geom-gcn.
Custom dataset should fit following format :

PROJECT_ROOT/new_data/DATASET_NAME/
out1_graph_edges.txt            # format for each lines : SRC_NODE DST_NODE
out1_node_feature_label.txt     # format for each rows  : NODE_ID f0,f1,···

Use model.py

If you only want to use model.py separately, you need to pass two matrix to forward function while training.

adj : torch.sparse.Tensor.
x : torch.FloatTensor.

h2gcn-pytorch's People

Contributors

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