-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reader, ParallelExecutor and refine for Transformer #894
Add reader, ParallelExecutor and refine for Transformer #894
Conversation
e336bd6
to
5d14d1c
Compare
5d14d1c
to
bca3c03
Compare
# the hyper parameters for Adam optimizer. | ||
learning_rate = 0.001 | ||
# This static learning_rate will multiply LearningRateScheduler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will multiply --> will be multiplied to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
if self._sort: | ||
self._pool.sort( | ||
key=lambda sample: max(len(sample[0]), len(sample[1])) if len(sample) > 1 else len(sample[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceed 80 columns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
end_mark="<e>", | ||
unk_mark="<unk>", | ||
seed=0): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to give an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Size of pool buffer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
: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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add reader, ParallelExecutor and refine for Transformer