Skip to content

Latest commit

 

History

History
58 lines (48 loc) · 2.53 KB

README.md

File metadata and controls

58 lines (48 loc) · 2.53 KB

InduCE: Inductive Counterfactual Explanations for Graph Neural Networks

InduCE-Pipeline Fig: Pipeline of the policy learning algorithm in INDUCE. δ indicates the maximum number of allowed perturbations.

Environment Details

We use Python 3.9.12 to run each file. We use Pytorch '1.11.0' with cuda '10.2.0'. Use ENV.yml file to create the environment required to run the source code.

conda env create --file=ENV.yml

Directory Related Instructions

cd source

Execution Instructions

INDUCTIVE VERSION

Train:

python ./src/train.py --dataset <syn4/syn1/syn5> --use_onehot --use_degree --use_entropy --ent 0.1 --policynet gat --maxbudget 15 --maxepisodes 500 --seed 42 --train_on_correct_only --k 4 --train_on_non_zero --verbose --save_prefix inductive_non0_correct_only

Test:

python ./src/test.py --dataset <syn4/syn1/syn5> --use_onehot --use_degree --use_entropy --ent 0.1 --policynet gat --maxbudget 15 --seed 42 --k 4  --verbose --save_prefix inductive_non0_correct_only 

TRANSDUCTIVE VERSION

python ./src/train_transductive.py --dataset <syn4/syn1/syn5> --use_onehot --use_degree --use_entropy --ent 0.1 --policynet gat --maxbudget 15 --maxepisodes 500 --seed 37 --train_on_non_zero  --train_on_correct_only --k 4 --verbose --save_prefix transductive_non0_correct_only 

*NOTE:

  1. For deletion version: use flag --del_only
  2. For checking usage of arguments refer to cmd_args.py