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

Conversion to nn.Module & Softmax added in forward #126

Merged
merged 1 commit into from
Mar 9, 2022

Conversation

gsarti
Copy link
Member

@gsarti gsarti commented Mar 9, 2022

Description

  • The AttributionModel and child classes are now torch.nn.Module. Consequently, score_func becomes the regular forward method, simplifying the code in the attribution methods and enabling us to eliminate the HookableModelWrapper class.

  • Following some examples, the output of the forward function of HuggingfaceModel is passed through a torch.softmax function. The effect of this operation is an increased sparsity in the saliency patterns, although most salient trends are preserved.

@gsarti gsarti merged commit 51780e6 into main Mar 9, 2022
@gsarti gsarti deleted the softmax-score-func branch March 9, 2022 16:22
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