Skip to content

nhuang37/GNN_community_detection

Repository files navigation

A SPECTRAL ANALYSIS OF GRAPH NEURAL NETWORKS ON DENSE AND SPARSE GRAPHS

This repo contains implementations of (1) sampling from a Dense-Sparse-Graph-Model (DSGM); (2) running graph neural networks (GNNs) and spectral embeddings (SEs) on random graphs from DSGM; (3) compare GNNs and SEs on real-world graphs.

Dependencies

You can follow the code below to install pytorch-geometric

import os
import torch
os.environ['TORCH'] = torch.__version__
pip install -q torch-scatter -f https://data.pyg.org/whl/torch-${TORCH}.html
pip install -q torch-sparse -f https://data.pyg.org/whl/torch-${TORCH}.html
pip install -q torch-cluster -f https://data.pyg.org/whl/torch-${TORCH}.html
pip install -q git+https://github.com/pyg-team/pytorch_geometric.git

Experiments

  • Simulation on DSGM (1),(2): Experiment_simulation.ipynb
  • Experiment on real-world datasets (3):
    • core modules: sparsity.py
    • Table 1: Experiment_real_world.ipynb
    • Table 2&3: Experiment_real_world_ablation.ipynb
  • Experiment results can be downloaded in result file

About

Code for paper "A Spectral Analysis of Graph Neural Networks on Dense and Sparse Graphs" (https://arxiv.org/abs/2211.03231)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published