g-Inspector is a recurrent attention model for graph objects classification, which applies the attention mechanism to investigate the significance of each region to classification.
This repository provides a reference implementation of g-Inspector.
g-Inspector source code package contains following files and folders.
- gInspector.py
- loader.py
- datasets/
In this example, mutag dataset is provided which has been embedded with DeepWalk. You can also use other graph embedding methods such as node2vec. In order to use your own data, you have to provide
- a graphs' label txt file, eg.
dataset/mutag_labels.txt
- a graphs' embedding folder, eg.
dataset/mutag/
You can specify a dataset as follows:
python gInspector.py --data mutag
To run g-Inspector on mutag, execute the following command from the project home directory:
python gInspector.py
You can check out the other options available to use with g-Inspector using:
python gInspector.py --help
Python 2.7 is required for g-Inspector.
Besides, following libs are needed:
- tensorflow
- numpy
- scikit-learn
These codes are tested on Mac OS and ubuntu.
Dr. Zhiling Luo [email protected] http://www.bruceluo.net
Yinghua Cui [email protected]
Zhiling Luo, Yinghua Cui, Sha Zhao, Jianwei Yin. g-Inspector: Recurrent Attention Model on Graph. IEEE Transactions on Knowledge and Data Engineering. 2020.