Skip to content

Commit

Permalink
Update nmt_with_attention
Browse files Browse the repository at this point in the history
For TF2.5

- Use the TextVectorization layer.
- Use the AdditiveAttention layer.
- tf.function the translate loop for text->text export.
- Add more inline explanations, and sanity checks.
- Add shape assertions throughout the code to make it easier to follow.

Fixes: tensorflow/tensorflow#38248
Fixes: tensorflow/tensorflow#39654
See also: tensorflow/tensorflow#49237
PiperOrigin-RevId: 370250185
  • Loading branch information
MarkDaoust authored and tf-text-github-robot committed May 25, 2021
1 parent a20cc17 commit 0d2a2fa
Show file tree
Hide file tree
Showing 6 changed files with 2,430 additions and 458 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tf_org_notebook_test(
deps = [
"//third_party/py/matplotlib",
# numpy dep,
"//third_party/py/sklearn",
"//third_party/py/tensorflow_text",
],
)

Expand Down
Binary file added docs/tutorials/images/attention_equation_1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/images/attention_equation_2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/images/attention_equation_3.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/tutorials/images/attention_equation_4.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0d2a2fa

Please sign in to comment.