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

Visualizing attention weights with input arrays #42

Closed
MichaelHopwood opened this issue Apr 25, 2020 · 1 comment
Closed

Visualizing attention weights with input arrays #42

MichaelHopwood opened this issue Apr 25, 2020 · 1 comment

Comments

@MichaelHopwood
Copy link

When predicting on test data with the trained model, how can I visualize the attention weights? I'd like to study where the model designates as "important areas".

For reference, my input data is usually of shape (100, 900, 4) with 3 output classification options.

Thanks!

@philipperemy
Copy link
Owner

You can refer to this example: https://github.com/philipperemy/keras-attention-mechanism/blob/47fc761276c0cd08ce5bb1068d93c52dac090569/examples/example-attention.py#L82

Here is the description of what is does: https://github.com/philipperemy/keras-attention-mechanism#adding-two-numbers

You should be able to adapt it with your input data and your model.

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

No branches or pull requests

2 participants