-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
[API DESIGN REVIEW] Recurrent Attention Layer(s) #7633
Comments
+1
…On Sun, Aug 13, 2017 at 1:29 PM, andhus ***@***.***> wrote:
I've laid out an API suggestion for application of attention mechanisms in
a *recurrent setting*.
Full design review doc: https://docs.google.com/document/d/
1psFXnmMlSTg5JapgZKz26ag-zBu3ERrxkKoEzNpzl4w/edit?usp=sharing
There is a proof-of-concept implementation of the API in my (play-ground)
add-on library extkeras
<https://github.com/andhus/extkeras/blob/master/extkeras/layers/attention.py>
as well as an example
<https://github.com/andhus/extkeras/blob/master/examples/attention/graves_sequence_attention.py>
of its use in model training.
There is still a lot of work needed, but if you think it's a good general
direction I'm happy to take lead in completing the implementation.
Happy for all feedback at any level!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#7633>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACWGWKeajqfYEYKV6BFYAYLzAPsVncwPks5sX1yYgaJpZM4O1yfi>
.
|
+1 |
This is important. Attention mechanisms is often used in various capacities in new papers. It would be highly beneficial to have a standard way to apply attention to general RNNs / LSTM / GRU. |
I fully agree that we need built-in support for RNN attention in Keras, and I think this is a solid first proposal. What would be some alternative proposals? If none, we will go with this one. |
As discussed in comments of the API Review doc, the introduction of standalone RNN Cells (#7943) will simplify and make addition of Recurrent Attention more modular. I'll adapt the API suggestion accordingly asap. |
@fchollet The API doc is now updated, see the PR:s above which covers most crucial parts. Let me know if you think it's on the right track and I'll continue with step 3 and 4 according document. The concept of standalone cells really makes these things more modular and neat :D |
@andhus I need a help . I've researched a lot but I'm stuck on something . I need to extract the attention weights . But couldn't find an tutorial or blog on how to do that . Just consider IMDB dataset , and after training , I will input a test data . Then I want to know which words in the test data are most important . I only know keras well . Is there any way ? For a better understanding I want something like deepmoji.mit.edu but it's simpler than that . Any kind of help by anyone is appreciated |
Closing this issue in favor of #11172 for organization purposes. This issue can be reopened later on if necessary. |
I've laid out an API suggestion for application of attention mechanisms in a recurrent setting.
Full design review doc: https://docs.google.com/document/d/1psFXnmMlSTg5JapgZKz26ag-zBu3ERrxkKoEzNpzl4w/edit?usp=sharing
There is a proof-of-concept implementation of the API in my (play-ground) add-on library extkeras as well as an example of its use in model training.
There is still a lot of work needed, but if you think it's a good general direction I'm happy to take lead in completing the implementation.
Happy for all feedback at any level!
The text was updated successfully, but these errors were encountered: