Skip to content

Feature/add nsteps param Closes #51 - #54

Merged
cdpierse merged 7 commits into
masterfrom
feature/add-nsteps-param
Jun 24, 2021
Merged

cdpierse merged 7 commits into
masterfrom
feature/add-nsteps-param

Conversation

@cdpierse

@cdpierse cdpierse commented Jun 24, 2021 •

Copy link
Copy Markdown
Owner

PR Description

This PR adds two new optional parameters to every explainer these are n_steps and internal_batch_size.

Both of these parameters are passed directly into Captum's LIGAttribution instance. n_steps controls how many steps occur from the integration between baseline inputs and actual inputs, in theory the more steps the more stable the explanations, increasing n_steps will increase the time it takes to calculate attributions, the default value in Captum is 50.

internal_batch_size is used to control the batch size of inputs. This feature is particularly useful for instances where transformers-interpret was going OOM due to the amount of gradient accumulation in one step (#51). Lowering internal_batch_size should greatly reduce memory overhead in situations where a single batch of gradients would cause OOM.

Motivation and Context

References issue: # (ISSUE)

Tests and Coverage

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Docs (Added to or improved Transformers Interpret's documentation)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Final Checklist:

  • My code follows the code style of this project.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@cdpierse cdpierse added the enhancement New feature or request label Jun 24, 2021
@cdpierse cdpierse self-assigned this Jun 24, 2021
@cdpierse
cdpierse merged commit deb65f3 into master Jun 24, 2021
@cdpierse
cdpierse deleted the feature/add-nsteps-param branch September 15, 2022 11:41
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.

1 participant