Skip to content

simonepiaggesi/disene

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DiSeNE: disentangled and self-explainable node representation learning

The code has been tested with Python 3.10.15. To run the scripts and reproduce results, set up the conda environment using the provided YAML file:

conda env create -f environment.yml
conda activate disene

If you use the code in this repository, please consider citing us:

@article{piaggesi2025disentangled,
   title={Disentangled and Self-Explainable Node Representation Learning},
   author={Simone Piaggesi and Andr{\'e} Panisson and Megha Khosla},
   journal={Transactions on Machine Learning Research},
   issn={2835-8856},
   year={2025}
}

Repository structure

Python scripts

In exps/real/ and exps/synth/ there are python scripts to train embeddings on real-world ("cora", "wiki", "facebook", "ppi") and synthetic data ("ring_of_cliques", "stochastic_block_model", "ba_cliques", "er_cliques", "tree_cliques", "tree_grids") respectively.

  python exp_disene.py --dataset \ (default 'cora' or 'ring_of_cliques')  
                         --model \ choose a model among 'isgc' (DiSe-GAE), 'imlp' (DiSe-FCAE)
                        --k-hops \ number of NN layers (default 1)
                   --window-size \ random walk window parameter (default 5)
                          --runs \ number of training experiments (default 5)
  python exp_baseline.py --dataset \ (default 'cora' or 'ring_of_cliques') 
                           --model \ choose a model among 'deepwalk', 'infwalk', 'gae', 'sage'
                            --runs \ number of training experiments (default 5)
  python exp_dine.py --dataset \ choose a dataset (default 'cora' or 'ring_of_cliques') 
                       --model \ choose a model among 'deepwalk', 'gae'
                        --runs \ number of training experiments (default 5)

The scripts save embeddings in the folders output/real/ and output/synth/. In each of these folders there will be two subfolders:

-linearshap_metrics/ contains numpy arrays to calculate Comprehensibility, Sparsity, Overlap Consistency, and Positional Coherence.

-shap_metrics/ contains numpy arrays to calculate Plausibility (only for synthetic data).

Jupyter notebooks

In exps/ there are two notebooks to compute metrics and show results:

-DiSeNE_cora.ipynb contains an example code to show the results for 'cora'.

-DiSeNE_synth.ipynb contains an example code to show the results for 'ring_of_cliques'.

About

Data and code repository from "Disentangled and Self-Explainable Node Representation Learning"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published