Skip to content

Instantly share code, notes, and snippets.

@joaquincabezas
joaquincabezas / gnn_explainer_example.py
Created February 19, 2021 11:25
Modified example of GNNExplainer usage with an adjusted coefficient for edge_size. It helps with stability and conciseness for explanations of small (10-100 edges) computation graphs
# Original example at
# https://github.com/rusty1s/pytorch_geometric/blob/master/examples/gnn_explainer.py
# In this modified version we take into account datasets where many nodes have a
# 2-hop neighbourhood comprising 10 to 100 edges. In theses cases, the current fixed
# value of the edge_size coefficient is not working as intented. We propose a
# variable coefficient, dependent on the number of edges of the 2-hop neighbourhood
# (we will consider this neighbourhood as the computation graph).
# More info at: https://github.com/rusty1s/pytorch_geometric/issues/1985
# or at @joaquincabezas

Keybase proof

I hereby claim:

  • I am joaquincabezas on github.
  • I am joaquincabezas (https://keybase.io/joaquincabezas) on keybase.
  • I have a public key ASCMPKZ5ubkHjigHVG6DdtC-KDYmpeR-gqtYL1PBDvCbPQo

To claim this, I am signing this object: