Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sequential IG method #222

Merged
merged 2 commits into from
Oct 18, 2023
Merged

Add Sequential IG method #222

merged 2 commits into from
Oct 18, 2023

Conversation

gsarti
Copy link
Member

@gsarti gsarti commented Oct 17, 2023

Description

This PR adds the Sequential Integrated Gradient attribution method by Enguehard (2023) (@josephenguehard). Provided a Captum-compatible implementation was already available in the original time_interpret library, I simply copied the class under the attr/ops folder, and added the required wrapper to enable sequential usage.

Example usage:

import inseq

m = inseq.load_model("gpt2", "sequential_integrated_gradients") 
out = m.attribute("What is the capital of Cambodia?")
out.show()

@gsarti gsarti added the enhancement New feature or request label Oct 17, 2023
@gsarti gsarti added this to the v0.5 milestone Oct 17, 2023
@gsarti gsarti merged commit d53be07 into main Oct 18, 2023
4 checks passed
@gsarti gsarti deleted the sequential-ig branch October 18, 2023 11:03
gsarti added a commit that referenced this pull request Oct 30, 2023
* origin/main:
  Attributed behavior for contrastive step functions (#228)
  Fix command for installing pre-commit hooks. (#229)
  Remove `max_input_length` from `model.encode` (#227)
  Migrate to `ruff format` (#225)
  Remove contrast_target_prefixes from contrastive step functions (#224)
  Step functions fixes, add `in_context_pvi` (#223)
  Format fixes, add Attanasio et al. (2023) to readme
  Add Sequential IG method (#222)
  Fix LIME and Occlusion outputs (#220)
  Update citation information
  Bump dependencies
  Add end_pos for contrast_targets_alignments
  Fix dummy output viz in console
  Minor fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant