Giter Site home page Giter Site logo

baldassarrefe / graph-network-explainability Goto Github PK

View Code? Open in Web Editor NEW
114.0 7.0 14.0 6.63 MB

Explainability techniques for Graph Networks, applied to a synthetic dataset and an organic chemistry task. Code for the workshop paper "Explainability Techniques for Graph Convolutional Networks" (ICML19)

Shell 0.01% Python 1.62% Jupyter Notebook 98.37%
graph-networks explainability bioinformatics artificial-intelligence

graph-network-explainability's Introduction

Explainability Techniques for Graph Convolutional Networks

Code and notebooks for the paper "Explainability Techniques for Graph Convolutional Networks" accepted at the ICML 2019 Workshop "Learning and Reasoning with Graph-Structured Data".

Overview

A Graph Network trained to predict the solubility of organic molecules is applied to sucrose, the prediction is explained using Layer-wise Relevance Propagation that assigns positive and negative relevance to the nodes and edges of the molecular graph:

Sucrose solubility LRP

The predicted solubility can be broken down to the individual features of the atoms and their bonds:

Sucrose solubility LRP nodes Sucrose solubility LRP edges

Code structure

  • src, config, data contain code, configuration files and data for the experiments
    • infection, solubility contain the code for the two experiments in the paper
    • torchgraphs contain the core graph network library
    • guidedbackrprop, relevance contain the code to run Guided Backpropagation and Layer-wise Relevance Propagation on top of PyTorch's autograd
  • notebooks, models contain a visualization of the datasets, the trained models and the results of our experiments
  • test contains unit tests for the torchgraphs module (core GN library)
  • conda.yaml contains the conda environment for the project

Setup

The project is build on top of Python 3.7, PyTorch 1.1+, torchgraphs 0.0.1 and many other open source projects.

A Conda environment for the project can be installed as:

conda env create -n gn-exp -f conda.yaml
conda activate gn-exp
python setup.py develop
pytest

Training

Detailed instructions for data processing, training and hyperparameter search can be found in the respective subfolders:

Experimental results

The results of our experiments are visualized through the notebooks in notebooks:

conda activate gn-exp
cd notebooks
jupyter lab 

graph-network-explainability's People

Contributors

baldassarrefe 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  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  avatar  avatar  avatar  avatar

graph-network-explainability's Issues

Question on how Message Passing is performed on torchgraphs

I am currently trying to implement LRP on my own graph neural network, focused on discovering relevances at the node feature level (on my own implementation) where node features are roughly updated as:

H_next = (A.dot(H)).dot(W)

I see however, that the torchgraph implementation, and thus the LRP step in your research solely multiplies the node features with the weights.

Thus I would like to better understand how the node adjacencies are taken into consideration for the computations?

Thank you, and thank you for the great research and examples!

Unable to setup the conda env & not able to install torchgraph

Hi,

The conda env installation/ creation is failing:
conda env create -n gn-exp -f conda.yaml
Collecting package metadata (repodata.json): done
Solving environment: failed

ResolvePackageNotFound:

  • fontconfig==2.13.0=h9420a91_0
  • zstd==1.3.7=h0b5b093_0
  • glib==2.56.2=hd408876_0
  • libgcc-ng==8.2.0=hdf63c60_1
  • cffi==1.12.2=py37h2e261b9_1
  • libtiff==4.0.10=h2733197_2
  • kiwisolver==1.0.1=py37hf484d3e_0
  • cudatoolkit==10.0.130=0
  • pyqt==5.9.2=py37h05f1152_2
  • pillow==5.4.1=py37h34e0f95_0
  • icu==58.2=h9c2bf20_1
  • libedit==3.1.20181209=hc058e9b_0
  • xz==5.2.4=h14c3975_4
  • libxcb==1.13=h1bed415_1
  • libffi==3.2.1=hd88cf55_4
  • mkl_random==1.0.2=py37hd81dba3_0
  • python==3.7.3=h0371630_0
  • pixman==0.38.0=h7b6447c_0
  • mkl_fft==1.0.12=py37ha843d7b_0
  • gmp==6.1.2=h6c8ec71_1
  • libgfortran-ng==7.3.0=hdf63c60_0
  • tornado==6.0.2=py37h7b6447c_0
  • libuuid==1.0.3=h1bed415_2
  • pcre==8.43=he6710b0_0
  • py-boost==1.67.0=py37h04863e7_4
  • yaml==0.1.7=had09818_2
  • gst-plugins-base==1.14.0=hbbd80ab_1
  • libsodium==1.0.16=h1bed415_0
  • readline==7.0=h7b6447c_5
  • pytorch==1.1.0=py3.7_cuda10.0.130_cudnn7.5.1_0
  • freetype==2.9.1=h8a8886c_1
  • sip==4.19.8=py37hf484d3e_0
  • rdkit==2019.03.1.0=py37hc20afe1_1
  • openssl==1.1.1c=h7b6447c_1
  • numpy-base==1.16.4=py37hde5b4d6_0
  • scipy==1.2.1=py37h7c811a0_0
  • ncurses==6.1=he6710b0_1
  • jpeg==9b=h024ee3a_2
  • mistune==0.8.4=py37h7b6447c_0
  • qt==5.9.7=h5867ecd_1
  • dbus==1.13.6=h746ee38_0
  • libpng==1.6.36=hbc83047_0
  • expat==2.2.6=he6710b0_0
  • sqlite==3.27.2=h7b6447c_0
  • libboost==1.67.0=h46d08c1_4
  • zlib==1.2.11=h7b6447c_3
  • tk==8.6.8=hbc83047_0
  • libstdcxx-ng==8.2.0=hdf63c60_1
  • pandas==0.24.2=py37he6710b0_0
  • libxml2==2.9.9=he19cac6_0
  • bzip2==1.0.6=h14c3975_5
  • matplotlib==3.0.3=py37h5429711_0
  • cairo==1.14.12=h8948797_3
  • gstreamer==1.14.0=hb453b48_1
  • pyrsistent==0.14.11=py37h7b6447c_0
  • pyyaml==5.1=py37h7b6447c_0
  • markupsafe==1.1.1=py37h7b6447c_0
  • cudnn==7.3.1=cuda10.0_0
  • pyzmq==18.0.0=py37he6710b0_0
  • ninja==1.9.0=py37hfd86e86_0
  • zeromq==4.3.1=he6710b0_3
  • scikit-learn==0.20.3=py37hd81dba3_0

and so, tried to install independently torchgraph:
$ pip install --user https://github.com/baldassarreFe/torchgraphs

Collecting https://github.com/baldassarreFe/torchgraphs
Downloading https://github.com/baldassarreFe/torchgraphs
- 121 kB 1.2 MB/s
ERROR: Cannot unpack file /private/var/folders/mj/fk1t3xm53gn_sd13cv2dq22c0000gp/T/pip-unpack-wt1i2ex1/torchgraphs (downloaded from /private/var/folders/mj/fk1t3xm53gn_sd13cv2dq22c0000gp/T/pip-req-build-xyu4u4km, content-type: text/html; charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of /private/var/folders/mj/fk1t3xm53gn_sd13cv2dq22c0000gp/T/pip-req-build-xyu4u4km

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.