GithubHelp home page GithubHelp logo

capsgnn's Introduction

CapsGNN

Hits

This repository contains an official TensorFlow implementation of Capsule Graph Neural Network (CapsGNN).

The implementation of dynamic routing refers to the [code]

Package Version

networkx    2.2
numpy       1.16.2
scipy       1.2.1
argparse    1.1
tensorflow  1.12.1

Basic Usage

Data Preparation

  1. We provide the preprocessing program to generate specific experimental data format. The default raw data format should be .gexf (avalaible at [gexf Dataset]). Each line of the label file represents a graph with the format
    xxx.gexf label

To generate experimental data format:

    $ python3 dataset_utils/preprocessing.py --dataset_input_dir graph_gexf/ENZYMES --output_data_dir data_plk --pickle_v 3 --x_fold 10 --gen_split_file True

Execute

  1. All the hyperparameters can be set in config.py and the training procedure can be executed through:
    $ python3 main.py --dataset_dir data_plk/ENZYMES --epochs 3000 --lambda_val 0.5

Citing

If you find CapsGNN is useful for your research, please consider citing the following paper:

@inproceedings{xinyi2018capsule,
   title={Capsule Graph Neural Network},
   author={Zhang Xinyi and Lihui Chen},
   booktitle={International Conference on Learning Representations},
   year={2019},
   url={https://openreview.net/forum?id=Byl8BnRcYm},
  }

Please send any questions you might have about the codes and/or the algorithm to [email protected].

capsgnn's People

Contributors

xinyiz001 avatar

Stargazers

 avatar  avatar  avatar  avatar JuneTse avatar Yavar Taheri Yeganeh avatar Derrick avatar Ellery Queen avatar Ramsey avatar Shuyue Jia avatar  avatar Guojia Wan avatar David Snowden avatar An-zhi WANG avatar James Chang avatar  avatar yangbaiyu avatar Sebastiano Manzella avatar  avatar  avatar xiaojingli avatar Xufeng Huang avatar Muhammet avatar maxhao avatar xiaozhuang avatar Meng Liu avatar Daniel Lima avatar  avatar  avatar dongkai.liang avatar  avatar  avatar Hanin avatar Ignavier Ng avatar 文明 avatar  avatar  avatar Zhenfei Luo avatar Houcaicai2.0 avatar  avatar ZhangZheng avatar CZ avatar Mathieu Nayrolles avatar  avatar  avatar  avatar  avatar Jayce avatar  avatar  avatar Kaiyuan Eric Chen avatar  avatar  avatar  avatar Tan Zhi Wei avatar Shubham Pachori avatar Slice avatar  avatar Chongruo Wu avatar  avatar  avatar Ziwenhan Song avatar 爱可可-爱生活 avatar Houye avatar Shuai Zhang avatar NedChen avatar  avatar Benny avatar Chaoda Zheng avatar Xu Shihao avatar Zyn avatar  avatar  avatar  avatar Woojeong Jin avatar

Watchers

James Chang avatar  avatar

capsgnn's Issues

关于这个数据集

如果我想要换一个图数据集来训练,也得是.gexf结构的吗?这个.gexf结构该怎么生成呢?

weight matrix of routing algorithm

Hi, thanks for your codes of GapsGNN. And I have a questions about the weight matrix in routing algorithm.
Suppose the size of the weight matrix is (batch_size, N, Ci, Co, d, d), I noticed in the paper that “different nodes from the same channel share the transform matrix”, so do I just initialize the weight matrix of size (Ci, Co, d, d), rather than (N, Ci, Co, d, d)?
Thanks again.

How to convert dataset into .gexf format?

Hi, Xinyi
Thank you very much for sharing your code on github!
I want to change another dataset(such as NCI or D&D) to run your code.But the dataset I found was json/CSV format.I can't change it to .gexf format.
Can you help me to solve this problem?
Looking forward for hearing from you!

some questions when I run your code

Thanks for your help!
When I run your code:
Traceback (most recent call last):
File "F:/CapsGNN-master-tensoeflow/main.py", line 186, in
main()
File "F:/CapsGNN-master-tensoeflow/main.py", line 46, in main
class_label_fname=class_labels_fname)
File "F:\CapsGNN-master-tensoeflow\dataset_utils\GraphDataset.py", line 11, in init
for file in os.listdir(input_dir):
FileNotFoundError: [WinError 3] System can not find the route.: 'data_plk/ENZYMES'

Question about node_indicator

Hi,
Thanks for providing the codes.
I am a bit confused about the node_indicator in the codes. In the codes it seems to be a mask for choosing nodes but I couldn't find any clues about it in the paper.
And it's computed by:
node_indicator = tf.reduce_max(batch_adj_mats, axis=-1, keep_dims=True) # (?, N, 1)
Is it used to indicate nodes that have connections to others?
And i didn't find any codes that adds self-connections to the graph: A + I . Are all the nodes in the graphs self-connected? If so, the node_indicator will be always full of "1"s, making no sense.

I am looking forward for you reply.

Question about training the model

Hi, Xinyi
Thank you very much for sharing your code on github!
I had run the code followed by the steps listed in README. But, when I trained the model by python3 main.py --dataset_dir data_plk/ENZYMES --epochs 3000 --lambda_val 0.5
the training program is stuck in an infinite loop, which means that, when training to step 2999, the program will start training from 0 again, it cannot stop the training at the step 3000.
What wrong with it?
Can you help me to solve this problem?
Looking forward for hearing from you!

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.