Decouple the program desc with batch_size in Transformer.#783
Merged
guoshengCS merged 9 commits intoPaddlePaddle:developfrom Apr 8, 2018
Merged
Decouple the program desc with batch_size in Transformer.#783guoshengCS merged 9 commits intoPaddlePaddle:developfrom
guoshengCS merged 9 commits intoPaddlePaddle:developfrom
Conversation
… fix-transformer-batchsize-dev
… fix-transformer-batchsize-dev
… fix-transformer-batchsize-dev
pkuyym
reviewed
Apr 8, 2018
| "de", dict_size=ModelHyperParams.trg_vocab_size, reverse=True) | ||
| # Append the <pad> token since the dict provided by dataset.wmt16 does | ||
| # not include it. | ||
| trg_idx2word[ModelHyperParams.trg_pad_idx] = "<pad>" |
| @@ -138,12 +144,14 @@ def test(exe): | |||
| test_avg_costs = [] | |||
| for batch_id, data in enumerate(val_data()): | |||
| if len(data) != TrainTaskConfig.batch_size: | |||
Collaborator
Author
There was a problem hiding this comment.
Done. Refine the validation and use the global statistics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Decouple the program desc with batch_size in Transformer. The inference program has been validated to have the same generated sentences for different batch size.
It relies on PaddlePaddle/Paddle#9008 .