Conversation
Job PR-648/1 is complete. |
Codecov Report
@@ Coverage Diff @@
## master #648 +/- ##
=======================================
Coverage 63.76% 63.76%
=======================================
Files 141 141
Lines 12870 12870
=======================================
Hits 8207 8207
Misses 4663 4663
|
Codecov Report
@@ Coverage Diff @@
## master #648 +/- ##
=========================================
+ Coverage 90.94% 91.04% +0.1%
=========================================
Files 64 64
Lines 5887 5887
=========================================
+ Hits 5354 5360 +6
+ Misses 533 527 -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!
@@ -199,11 +199,11 @@ def _get_rnn_cell(mode, num_layers, input_size, hidden_size, | |||
Only available when the mode=lstmpc. | |||
""" | |||
|
|||
assert mode == 'lstmpc' and proj_size is not None, \ | |||
assert mode == 'lstmpc' or proj_size is None, \ |
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.
Nice catch! proj_size
is required for lstmpc
. One simple modification would be removing mode == lstmpc
, and add a condition if mode == 'lstmpc'
.
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.
Sorry in the last review I didn't realize this change will break lstmpc cell. What about moving the assertion inside LSTMPCellWithClip
to check proj_size
, cell_clip
and proj_clip
?
gluon-nlp/src/gluonnlp/model/lstmpcellwithclip.py
Lines 85 to 97 in aa2c7e6
super(LSTMPCellWithClip, self).__init__(hidden_size, | |
projection_size, | |
i2h_weight_initializer, | |
h2h_weight_initializer, | |
h2r_weight_initializer, | |
i2h_bias_initializer, | |
h2h_bias_initializer, | |
input_size, | |
prefix=prefix, | |
params=params) | |
self._cell_clip = cell_clip | |
self._projection_clip = projection_clip |
@@ -199,11 +199,11 @@ def _get_rnn_cell(mode, num_layers, input_size, hidden_size, | |||
Only available when the mode=lstmpc. | |||
""" | |||
|
|||
assert mode == 'lstmpc' and proj_size is not None, \ | |||
assert mode == 'lstmpc' or proj_size is None, \ |
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.
Sorry in the last review I didn't realize this change will break lstmpc cell. What about moving the assertion inside LSTMPCellWithClip
to check proj_size
, cell_clip
and proj_clip
?
gluon-nlp/src/gluonnlp/model/lstmpcellwithclip.py
Lines 85 to 97 in aa2c7e6
super(LSTMPCellWithClip, self).__init__(hidden_size, | |
projection_size, | |
i2h_weight_initializer, | |
h2h_weight_initializer, | |
h2r_weight_initializer, | |
i2h_bias_initializer, | |
h2h_bias_initializer, | |
input_size, | |
prefix=prefix, | |
params=params) | |
self._cell_clip = cell_clip | |
self._projection_clip = projection_clip |
Thanks for the fix, @MarisaKirisame. Would you have some time to address the comments? Let me know how I can help. |
@szha hi, sorry for the delay! I was pushing for a conference deadline for a week (this come up). Now that it is over I can actually write other code. I will look at this and fix ASAP. |
Job PR-648/3 is complete. |
Job PR-648/2 is complete. |
@eric-haibin-lin I cannot move them inside. |
@eric-haibin-lin ping. |
@MarisaKirisame sorry for the late reply. If a cell is passed, we still need to contruct a cell somewhere. What about just fixing the assertion in the following way?
|
@eric-haibin-lin that is what the current fix do, it is just in different form. Is there reason to prefer one over the other? |
nvm. The current fix looks good. Just triggered the CI again. Thanks for the fix! |
Job PR-648/2 is complete. |
No description provided.