Code Monkey home page Code Monkey logo

ai4ua's Introduction

L65 Project Repository

Forked from AI4UA repository and uses the code from Global Explainability of GNNs via Logic Combination of Learned Concepts repo to implement GLGExplainer.

Repository for the L65 Geometric Deep Learning mini-project completed by Luke Braithwaite and Matthew Hattrup during Lent term 2024.

Requirements

  • pytorch
  • pytorch-geometric
  • networkx
  • numpy

Torch geometric installation

Follow instructions in https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html.

pip install torch_geometric

pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-1.13.0+cu117.html

Running the code

The pipeline consists of the following steps all of which can be performed using the cli included in main.py. They are:

  1. Generating the lattice dataset.
  2. Training the GNN to classify the lattice properties you would like.
  3. Training a local explanation extractor to generate the explanation subgraphs from the input lattices.
  4. Train GLGExplainer to use the extracted local explanations.

Generating the lattice dataset

This can be performed by running the file gnn4Uua/datasets/runner. Currently the CLI does not support this operation.

Training the GNNs

Run the following command to train the GNNs on each task

python main.py train-gnns

Extracting local explanations

Run the following to extract the local explanations using GNNExplainer

python main.py extract-motifs --task=Distributive --generalisation_mode=strong --seed=102 --n_epochs=100

Training GLGExplainer

Run the following command to train GLGExplainer on a specific task

python main.py train-explainer --task=Distributive --generalisation_mode=strong --seed=102

ai4ua's People

Contributors

aspiecoder1 avatar fragiannini avatar pietrobarbiero avatar stefanof66 avatar keskin-oguzhan avatar

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.