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

Bug fix for explainer attributes visalization #12

Merged
merged 3 commits into from
Jan 4, 2023

Conversation

kamilrzechowski
Copy link
Collaborator

@kamilrzechowski kamilrzechowski commented Dec 27, 2022

Description

Captum visualization method captum.attr.visualization.visualize_image_attr_multiple allows us to visualize positive, negative, and both attributes together. Sometimes, however, the input image doesn't have negative or positive attributes contributing to the model output. In such a case captum visualization tool throws an error. The given PR introduces a fix, which checks the explainer attributes for the presents of positive and negative attributes and requests only attributes, that are present.

Additionally, the PR adds the logger creation function.

Checklist:

  • I have updated all related pyproject.toml files.
  • I have updated lock files.
  • I have set an Assignee and Reviewers.
  • I have labeled the PR correctly.
  • I have performed a self-review of my own code.
  • I have covered my code and changes with unit tests.
  • I have annotated types as extensively as possible.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • All code references and dependencies will work.

@kamilrzechowski kamilrzechowski added the bug Something isn't working label Dec 27, 2022
@kamilrzechowski kamilrzechowski self-assigned this Dec 27, 2022
@kamilrzechowski kamilrzechowski mentioned this pull request Dec 27, 2022
12 tasks
Copy link
Collaborator

@adamwawrzynski adamwawrzynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

autoxai/explainer/base_explainer.py Outdated Show resolved Hide resolved
adamwawrzynski pushed a commit that referenced this pull request Dec 28, 2022
Signed-off-by: Adam Wawrzyński <adam.wawrzynski@reasonfieldlab.com>
adamwawrzynski added a commit that referenced this pull request Dec 28, 2022
* Change kwargs argument name, unify 'layer' argument name passed to explainers

* Fix docstrings of create_explainer function

* Add Saliency algorithm

* Add DeepLIFT algorithm

* Add DeepLIFT SHAP algorithm

* Add Deconvolution algorithm

* Add Input x Gradient algorithm

* Add Layer Conductance algorithm

* Add standardization of matrices, generate figure with respect to presence of negative attributions

* Revert visualization error handling due to #12 PR

* Mark model argument type with TODO

* Remove incorrect standardization method

* Bump patch version
@kamilrzechowski kamilrzechowski merged commit 2f96929 into main Jan 4, 2023
@adamwawrzynski adamwawrzynski deleted the fix/vizualization branch February 13, 2023 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants