Skip to content

Add feature attribution maps#55

Open
WillcolsonRx wants to merge 1 commit into
facebookresearch:mainfrom
WillcolsonRx:feature-attribution-maps
Open

Add feature attribution maps#55
WillcolsonRx wants to merge 1 commit into
facebookresearch:mainfrom
WillcolsonRx:feature-attribution-maps

Conversation

@WillcolsonRx

Copy link
Copy Markdown

Summary

Adds modality-by-time attribution support for TRIBE v2 predictions.

  • Introduces feature-level integrated gradients and occlusion attribution utilities.
  • Adds FmriEncoderModel.attribute(...) for model-level explanations.
  • Adds TribeModel.attribute(...) for high-level batch attribution over events.
  • Documents the new API in the README.
  • Adds focused unit tests around output targeting, integrated gradients, occlusion, and batch restoration.

The attribution operates on cached text/audio/video feature tensors consumed by the encoder rather than raw tokens, waveforms, or pixels. This keeps the feature scoped to the current extractor architecture while enabling users to inspect which modality-time regions drive selected cortical predictions.

Validation

  • python -m pytest tests\test_attribution.py
  • python -m compileall -q tribev2 tests
  • python -m ruff check --select E9,F tribev2\attribution.py tribev2\model.py tribev2\demo_utils.py tests\test_attribution.py

Note: a full repo-wide lint run still reports pre-existing issues in untouched files, so this PR validates the new and touched attribution paths only.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 25, 2026
@WillcolsonRx WillcolsonRx marked this pull request as ready for review April 25, 2026 16:24
@WillcolsonRx

Copy link
Copy Markdown
Author

“This adds feature-level modality/time attribution for TRIBE predictions using integrated gradients and occlusion over cached encoder inputs.”

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

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant