You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add AttentionMechanismV2 that follows Keras API style.
1. Adding new base class for AttentionMechanism that use keras.layer as parent.
2. All the new AttentionMechanismV2 will accept tensors from call() instead of
as __init__ parameters.
3. memory_length has been update to memory_mask in v2 which is more align with
the keras API.
4. _luong_score() and _bahdanau_score() has been updated to not create variable
by itself. All the variable are now passed in as parameters.
5. All the existing unit tests are still passing. I haven't add new unit test
for v2 class yet, will add them once I update the AttentionWrapper to v2.
PiperOrigin-RevId: 229821776
0 commit comments