GithubHelp home page GithubHelp logo

hmohebbi / valuezeroing Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 3.0 68 KB

The official repo for the EACL 2023 paper "Quantifying Context Mixing in Transformers"

Python 100.00%
attention-mechanism contextualized-representation feature-attribution interpretability pre-trained-language-models transformers

valuezeroing's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

valuezeroing's Issues

What is "target_index" on BertForMaskedLM?

First of all, thanks for sharing the code! I'm trying to use ValueZeroing on some experiments, and I noticed that the class BertForMaskedLM has the parameter target_index initialized as None and used in this line:

# Added by Hosein  
prediction_scores = prediction_scores[torch.arange(prediction_scores.size(0)), target_index]

But in the demo it is not passed to the model during the forward pass, so it remains None (changing the dimensions of prediciton_scores?). So, what is this parameter used for? What am I missing?

Thanks a lot in advance,
Luca

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.