Add reader, ParallelExecutor and refine for Transformer#894
Merged
pkuyym merged 4 commits intoPaddlePaddle:developfrom May 18, 2018
Merged
Add reader, ParallelExecutor and refine for Transformer#894pkuyym merged 4 commits intoPaddlePaddle:developfrom
pkuyym merged 4 commits intoPaddlePaddle:developfrom
Conversation
e336bd6 to
5d14d1c
Compare
5d14d1c to
bca3c03
Compare
pkuyym
requested changes
May 9, 2018
| batch_size = 32 | ||
| # the hyper parameters for Adam optimizer. | ||
| learning_rate = 0.001 | ||
| # This static learning_rate will multiply LearningRateScheduler |
Contributor
There was a problem hiding this comment.
will multiply --> will be multiplied to
|
|
||
| if self._sort: | ||
| self._pool.sort( | ||
| key=lambda sample: max(len(sample[0]), len(sample[1])) if len(sample) > 1 else len(sample[0]) |
| end_mark="<e>", | ||
| unk_mark="<unk>", | ||
| seed=0): | ||
| """ |
Contributor
There was a problem hiding this comment.
The comments shouldn't be here.
class DataReader(object):
"""Comments for the constructor"""
| :type src_vocab_fpath: basestring | ||
| :param trg_vocab_fpath: The path of vocabulary file of target language. | ||
| :type trg_vocab_fpath: basestring | ||
| :param fpattern: The pattern to match data files. |
| or the maximum number of tokens (include paddings) contained in a | ||
| mini-batch. | ||
| :type batch_size: int | ||
| :param pool_size: The buffer size to pool data. |
| :param sort_type: The grain to sort by length: 'global' for all | ||
| instances; 'pool' for instances in pool; 'none' for no sort. | ||
| :type sort_type: basestring | ||
| :param sort_type: The grain to sort by length: 'global' for all |
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.
Add reader, ParallelExecutor and refine for Transformer