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 min_examples_per_batch to FeatureAblation/FeaturePermutation #1533

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sarahtranfb
Copy link
Contributor

Summary:
For sparse features, the 0th dim is not always the batch size.
Currently for FeatureAblation, we skip the input tensor if there are no elements in it. For FeaturePermutation, we throw if we cannot permute across the "batch" (i.e. the tensor has only one element).
min_examples_per_batch parameterizes the above behavior. For FeaturePermutation, the default is set to 2, meaning we no longer throw by default, but return an attribution score of 0

Differential Revision: D71980024

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71980024

sarahtranfb added a commit to sarahtranfb/captum that referenced this pull request Mar 28, 2025
…orch#1533)

Summary:

For sparse features, the 0th dim is not always the batch size.
Currently for FeatureAblation, we skip the input tensor if there are no elements in it. For FeaturePermutation, we throw if we cannot permute across the "batch" (i.e. the tensor has only one element).
`min_examples_per_batch` parameterizes the above behavior. For FeaturePermutation, the default is set to 2, meaning we no longer throw by default, but return an attribution score of 0

Reviewed By: jjuncho

Differential Revision: D71980024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71980024

…orch#1533)

Summary:

For sparse features, the 0th dim is not always the batch size.
Currently for FeatureAblation, we skip the input tensor if there are no elements in it. For FeaturePermutation, we throw if we cannot permute across the "batch" (i.e. the tensor has only one element).
`min_examples_per_batch` parameterizes the above behavior. For FeaturePermutation, the default is set to 2, meaning we no longer throw by default, but return an attribution score of 0

Reviewed By: jjuncho

Differential Revision: D71980024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D71980024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants