Skip to content

Commit b797012

Browse files
qlzh727tensorflower-gardener
authored andcommitted
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
1 parent ee0cc9c commit b797012

File tree

1 file changed

+851
-111
lines changed

1 file changed

+851
-111
lines changed

0 commit comments

Comments
 (0)