Giter Site home page Giter Site logo

chandlerbang / simp-gcn Goto Github PK

View Code? Open in Web Editor NEW
56.0 3.0 12.0 5.71 MB

Implementation of the WSDM 2021 paper "Node Similarity Preserving Graph Convolutional Networks"

Python 96.18% Shell 3.82%
graph-neural-networks graph-convolutional-networks adversarial-attacks robustness deep-learning graph-mining

simp-gcn's Introduction

SimP-GCN

A Pytorch implementation of "Node Similarity Preserving Graph Convolutional Networks" (WSDM 2021). [paper]

Abstract

Graph Neural Networks (GNNs) explore the graph structure and node features by aggregating and transforming information within node neighborhoods. However, through theoretical and empirical analysis, we reveal that the aggregation process of GNNs tends to destroy node similarity in the original feature space. But there are many scenarios where node similarity plays a crucial role. Thus, it has motivated the proposed framework SimP-GCN that can effectively and efficiently preserve node similarity while exploiting graph structure. We validate the effectiveness of SimP-GCN on seven benchmark datasets including three assortative and four disassorative graphs. The results demonstrate that SimP-GCN outperforms representative baselines. Further probe shows various advantages of the proposed framework.

Requirements

See that in https://github.com/ChandlerBang/SimP-GCN/blob/main/requirements.txt

tqdm==4.42.0
torch==1.2.0
ipdb==0.13.2
scipy==1.4.1
dgl==0.5.2
numpy==1.17.4
pandas==1.0.3
networkx==2.3
scikit_learn==0.23.2
tensorboardX==2.1

Installation

pip install -r requirements.txt

Reproduce the results

All the hyper-parameters settings are included in scripts folder. For example, you can run the following commands.

sh scripts/assortative/cora.sh
sh scripts/disassortative/actor.sh

You can run python run.py to get all the results. Make sure you have installed the same version of depedencies.

Note that for adversarial robustness, you need to install DeepRobust as follows:

git clone https://github.com/DSE-MSU/DeepRobust.git
cd DeepRobust
python setup.py install

You might also need to delete the saved cora temporary files generated by experiments on assortative graphs. It is because when evaluating adversarail robustness we use the largest connected component of the graph instead of the entire graph.

rm saved/cora* 
sh scripts/adversarial/cora.sh

You can also choose to run the test example (test_simpgcn.py) in DeepRobust.

python DeepRobust/deeprobust/exmaples/graphs/test_simpgcn.py --dataset cora --ptb_rate 0.2

Acknowledgement

This repository is modified from SelfTask-GNN, DropEdge and Geom-GCN. We sincerely thank them for their contributions.

Cite

For more information, you can take a look at the paper.

If you find this repo to be useful, please cite our paper. Thank you.

@inproceedings{jin2020node,
  title={Node Similarity Preserving Graph Convolutional Networks}, 
  author={Jin, Wei and Derr, Tyler and Wang, Yiqi and Ma, Yao and Liu, Zitao and Tang, Jiliang},
  booktitle={Proceedings of the 14th ACM International Conference on Web Search and Data Mining},
  year={2021},
  organization={ACM}
}

simp-gcn's People

Contributors

chandlerbang 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

Watchers

 avatar  avatar  avatar

simp-gcn's Issues

Edge Weights in Adjacency Matrix

Would this code accommodate a graph with edge weights? Ideally I would want to use edge weights in the GCN adjacency matrix instead of '1's and '0's.

codes for Table 1

Hello, I would like to ask about the reproduce of Table 1. How do I reproduce the results? Generate the adjacency matrix and calculate the percentage by myself or am I missing something?

Some questions about model_simp.py.

According to my understanding, in line 190-192 of model_simp.py:
" for i in range(len(self.midlayer)):
midgc = self.midlayer[i]
x = midgc(x, adj)"
"x" represents P^(l) in the paper, but I am confused about operation "midgc(x, adj)". Can you tell me which formula that "midgc(x, adj)" corresponds to in the paper?
Thanks!

I have a question about the code

About ‘Adaptive Integration’,in which file in the code is this function implemented,‘model’ or ‘layer’?
And in which methods is it implemented?Please tell me ,and thank you for your answer.

Node embedding dimension

Argument 'hidden' controls the vector dimension of nodes? As you run the graph (adj matrix) through the gcn

The resulting size of the node vectors is the hidden value (128) or is it adjusted by the features as well?

some function is not defined

Hello I am a beginner. See the code address from your paper. There are some problems here:
In models_simp.py there GraphConvolution and GCFlatResBlock not defined
And in normalization.py
image
Can these problems be solved if I download deeprobust?

About pubmed dataset result

I want to reproduce the result on the PubMed dataset with a 0.00 perturbation rate. However, I can't get the same results recorded in your paper while I just modify the ptb_rate to 0 in the .sh file. Does there need another hyperparameters setting since the providing .sh file corresponds to ptb_rate = 0.15?

reproduce problem

Hello,I try to reproduce the result.Other datesets are ok,but there are two problems in reproducing Cora.
problem
I searched some solutions about relative problems,but can't fix it.
So I ask for your help.Thank 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.