GithubHelp home page GithubHelp logo

gianluigilopardo / attention_meets_xai Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 47.27 MB

Code for the paper "Attention Meets Post-hoc Interpretability: A Mathematical Perspective"

Jupyter Notebook 88.11% Python 11.89%

attention_meets_xai's Introduction

Attention Meets Post-hoc Interpretability: A Mathematical Perspective

Welcome to the official repository for the paper Attention Meets Post-hoc Interpretability: A Mathematical Perspective.

Getting Started

To install the necessary dependencies, run the following command:

pip install -r requirements.txt

Code Structure

  • multi_head_trainer.py: This script is responsible for training the multi-head classifier. The classifier is defined in the models/multi_head.py file and its structure is detailed in Section 2 of the paper.
  • params.py: This file contains all the parameters required for the model and the experiments. It serves as a centralized location for managing experiment configurations.

Notebooks

The repository includes several Jupyter notebooks for generating the figures in the paper:

  • attention_meets_xai.ipynb: generates Figure 1.
  • attention_heads.ipynb: generates Figure 3.
  • lime_meets_attention.ipynb: generates Figure 4.
  • gradient_meets_attention.ipynb: generates Figure 5.

The generated figures can be found in the results/paper directory.

Quantitative experiments

  • quant_gradient.py and quant_lime.py: These scripts contain the code for large-scale quantitative experiments for the Gradient and LIME sections, respectively.

attention_meets_xai's People

Contributors

gianluigilopardo avatar

Stargazers

 avatar Kensuke Mitsuzawa avatar  avatar  avatar Debora Caldarola avatar  avatar

Watchers

 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.