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

Tests: Added tests for Attributors #119

Merged
merged 2 commits into from
Apr 12, 2022
Merged

Tests: Added tests for Attributors #119

merged 2 commits into from
Apr 12, 2022

Conversation

chr5tphr
Copy link
Owner

Tests: Added tests for Attributors

Fixtures:

  • add fixture for common grad_output functions, with an extra function
    one_hot_max
  • add fixture for a simple model, which uses any of the linear module
    fixture, followed by a relu, followed by a dense layer with 4 outputs
  • add a fixture for the simple model's gradient
  • add a fixture for the simple model's output

Helpers:

  • add the IdentityLogger helper in test_attribution.py, which is a
    torch.nn.Module which clones, logs and returns the input

Tests:

  • add various tests for all attributors, which currently are Gradient,
    IntegratedGradients, SmoothGrad and Occlusion

Tests: Move composite fixtures to conftest

  • move composite fixtures to conftest such that they can be used by
    other tests, and to conform to the 'fixtures in conftest.py' structure
  • rename fixture 'composite_model' to 'model_vision'
  • add alexnet to the model_vision fixture

- move composite fixtures to conftest such that they can be used by
  other tests, and to conform to the 'fixtures in conftest.py' structure
- rename fixture 'composite_model' to 'model_vision'
- add alexnet to the model_vision fixture
Fixtures:
- add fixture for common grad_output functions, with an extra function
  one_hot_max
- add fixture for a simple model, which uses any of the linear module
  fixture, followed by a relu, followed by a dense layer with 4 outputs
- add a fixture for the simple model's gradient
- add a fixture for the simple model's output

Helpers:
- add the IdentityLogger helper in test_attribution.py, which is a
  torch.nn.Module which clones, logs and returns the input

Tests:
- add various tests for all attributors, which currently are Gradient,
  IntegratedGradients, SmoothGrad and Occlusion
@chr5tphr chr5tphr closed this Apr 12, 2022
@chr5tphr chr5tphr reopened this Apr 12, 2022
@chr5tphr chr5tphr merged commit 86d1134 into master Apr 12, 2022
@chr5tphr chr5tphr deleted the tests-attribution branch April 12, 2022 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant