Skip to content

Commit

Permalink
Moved files to this repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ymahlau committed May 7, 2023
0 parents commit 58a2117
Show file tree
Hide file tree
Showing 111 changed files with 3,423 additions and 0 deletions.
132 changes: 132 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

.idea
datasets

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test_installation / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SubgraphX Reproducibility

Reproducing results from the [SubgraphX](http://proceedings.mlr.press/v139/yuan21c.html) paper including a full re-implementation of the SubgraphX algorithm in PyTorch-Geometric.

The author's implementation can be found [here](https://github.com/divelab/DIG/blob/dig/dig/xgraph/method/subgraphx.py).

# Installation
For our experiments we use parts of the [DIG](https://github.com/divelab/DIG) library which restricts compatibility. Therefore, we recommend the following installation process:

```
conda env create -f environment.yml
conda activate subgraphx
```
To run the scripts from the project's root directory, make its path available to python:
```
export PYTHONPATH=.
```

Binary file added checkpoints/ba_2motifs/gcn_2.pt
Binary file not shown.
Binary file added checkpoints/ba_2motifs/gcn_best.pth
Binary file not shown.
Binary file added checkpoints/ba_2motifs/gcn_latest.pth
Binary file not shown.
Binary file added checkpoints/ba_2motifs/gcn_temp.pt
Binary file not shown.
Binary file added checkpoints/karate_club/emb
Binary file not shown.
Binary file added checkpoints/karate_club/gcn.pt
Binary file not shown.
Binary file added checkpoints/mutag/gcn.pt
Binary file not shown.
Binary file added checkpoints/mutag/gin.pt
Binary file not shown.
Binary file added checkpoints/ppi/emb2.model
Binary file not shown.
Binary file added checkpoints/ppi/link_pred.model
Binary file not shown.
20 changes: 20 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: subgraphx
channels:
- pytorch
- defaults
dependencies:
- pip
- python=3.7
- pytorch=1.10
- torchvision
- torchaudio
- cudatoolkit=11.3
- pip:
- -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
- torch-scatter
- torch-sparse
- torch-cluster
- torch-spline-conv
- torch-geometric
- dive-into-graphs==0.1.2

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/karate_club/experiments/final_fidelity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/karate_club/graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/karate_club/karate_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/karate_club/karate_results_once_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/mutag/gcn_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/mutag/gin_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/mutag/gin_result_all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ppi/ppi_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/ppi/ppi_result2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added result_data/karate_club/experiments/greedy_one
Binary file not shown.
Binary file not shown.
Binary file added result_data/karate_club/experiments/m1000_random
Binary file not shown.
Binary file not shown.
Binary file added result_data/karate_club/experiments/m20t100
Binary file not shown.
Binary file added result_data/karate_club/experiments/m20t20
Binary file not shown.
Binary file added result_data/karate_club/experiments/m20t5
Binary file not shown.
Binary file added result_data/karate_club/experiments/m30t50
Binary file not shown.
Binary file added result_data/karate_club/ggn_exp_dict
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions result_data/karate_club/notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Explanation of Node 16 very low runtime: range of 10-300ms
Explanation of Node 31 very high runtime: 300-400s
2 changes: 2 additions & 0 deletions result_data/karate_club/runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Subgraphx: 80.53241294149369
GNN Explainer: 9.03118109703064
Binary file added result_data/karate_club/subgraphx_dict
Binary file not shown.
Binary file added result_data/karate_club/subgraphx_new_dict
Binary file not shown.
Binary file added result_data/karate_club/subgraphx_new_dict2
Binary file not shown.
Binary file added result_data/karate_club/subgraphx_new_dict3_once
Binary file not shown.
Binary file added result_data/mutag/experiments_gcn/m100_random
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added result_data/mutag/experiments_gcn/m20_fidelity
Binary file not shown.
Binary file not shown.
Binary file added result_data/mutag/experiments_gcn/m20t100
Binary file not shown.
Binary file added result_data/mutag/experiments_gcn/m20t100_greedy
Binary file not shown.
Binary file added result_data/mutag/experiments_gcn/m20t20
Binary file not shown.
Binary file added result_data/mutag/experiments_gcn/m20t5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added result_data/mutag/experiments_gin/m100_random
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added result_data/mutag/experiments_gin/m20_fidelity
Binary file not shown.
Binary file not shown.
Binary file added result_data/mutag/experiments_gin/m20t100
Binary file not shown.
Binary file added result_data/mutag/experiments_gin/m20t100_greedy
Binary file not shown.
Binary file added result_data/mutag/experiments_gin/m20t20
Binary file not shown.
Binary file added result_data/mutag/experiments_gin/m20t5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added result_data/mutag/gcn_gnnexp
Binary file not shown.
Binary file added result_data/mutag/gcn_mctsgnn
Binary file not shown.
3 changes: 3 additions & 0 deletions result_data/mutag/gcn_runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Subgraphx: 423.75557497669666
GNN Explainer: 11.086324083177667
MCTS_GNN: 6.448645736890681
Binary file added result_data/mutag/gcn_subgx
Binary file not shown.
Binary file added result_data/mutag/gin_gnnexp
Binary file not shown.
Binary file added result_data/mutag/gin_gnnexp_all
Binary file not shown.
Binary file added result_data/mutag/gin_mctsgnn
Binary file not shown.
Binary file added result_data/mutag/gin_mctsgnn_all
Binary file not shown.
3 changes: 3 additions & 0 deletions result_data/mutag/gin_runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Subgraphx: 160.95848386638303
GNN Explainer: 6.625155875557347
MCTS_GNN: 2.965972328186035
Binary file added result_data/mutag/gin_runtime_experiment_GNNExp
Binary file not shown.
Binary file added result_data/mutag/gin_runtime_experiment_MCTS
Binary file not shown.
3 changes: 3 additions & 0 deletions result_data/mutag/gin_runtime_experiment_results.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Subgraphx: 45.879567422364886
GNN Explainer: 6.824011752479954
MCTS_GNN: 1.8577266366858232
Binary file added result_data/mutag/gin_runtime_experiment_subX
Binary file not shown.
Binary file added result_data/mutag/gin_subgx
Binary file not shown.
Binary file added result_data/mutag/gin_subgx_all
Binary file not shown.
1 change: 1 addition & 0 deletions result_data/ppi/runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Subgraphx runtime avg: 214.11513061523436
Binary file added result_data/ppi/subgraphx_dict
Binary file not shown.
Loading

0 comments on commit 58a2117

Please sign in to comment.