-
Notifications
You must be signed in to change notification settings - Fork 538
[Transformer] Skip dropout layer when rate=0 #597
Conversation
Job PR-597/1 is complete. |
Codecov Report
@@ Coverage Diff @@
## master #597 +/- ##
=========================================
- Coverage 65.12% 64.6% -0.52%
=========================================
Files 135 135
Lines 12397 12199 -198
=========================================
- Hits 8073 7881 -192
+ Misses 4324 4318 -6
|
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.
Thanks for the contribution! One comment:
@@ -106,7 +107,8 @@ def __init__(self, units=512, hidden_size=2048, dropout=0.0, use_residual=True, | |||
weight_initializer=weight_initializer, | |||
bias_initializer=bias_initializer, | |||
prefix='ffn_2_') | |||
self.dropout_layer = nn.Dropout(dropout) |
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.
Might as well change
gluon-nlp/src/gluonnlp/model/transformer.py
Line 207 in 972d866
self.dropout_layer = nn.Dropout(dropout) |
gluon-nlp/src/gluonnlp/model/transformer.py
Line 339 in 972d866
self.dropout_layer = nn.Dropout(dropout) |
gluon-nlp/src/gluonnlp/model/transformer.py
Line 719 in 972d866
self.dropout_layer = nn.Dropout(dropout) |
and
gluon-nlp/src/gluonnlp/model/transformer.py
Line 854 in 972d866
self.dropout_layer = nn.Dropout(dropout) |
?
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.
Sure. Will change them accordingly.
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.
Thanks. Would you mind also adding the case when dropout is set to 0 in the unit test? https://github.com/dmlc/gluon-nlp/blob/master/tests/unittest/test_models.py#L75
Looks ok to me. |
Looks like the failure in CI is not related to the changes in this PR. Any idea about how to get it passed? |
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.
Looks good pending unit tests
@@ -106,7 +107,8 @@ def __init__(self, units=512, hidden_size=2048, dropout=0.0, use_residual=True, | |||
weight_initializer=weight_initializer, | |||
bias_initializer=bias_initializer, | |||
prefix='ffn_2_') | |||
self.dropout_layer = nn.Dropout(dropout) |
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.
Thanks. Would you mind also adding the case when dropout is set to 0 in the unit test? https://github.com/dmlc/gluon-nlp/blob/master/tests/unittest/test_models.py#L75
Sure, will change accordingly. |
Job PR-597/5 is complete. |
Job PR-597/6 is complete. |
* skip droput layer when rate=0 * address comments * fix complain of CI * retrigger * trigger CI * add test for dropout=0
Description
#596
Checklist
Essentials
Changes
Comments