-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix for bug #10868: _backward_softsign activation is incorrect #11827
Conversation
problem was that softsign was computed using outputs instead of inputs added inputs to list, and changed what gets passed into softsign calculation added softsign test to test_activation function code reviewed by anirudh
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 a lot for making the change. Please fix lint. Also don't forget to add yourself to https://github.com/apache/incubator-mxnet/blob/master/CONTRIBUTORS.md
src/operator/nn/activation.cc
Outdated
const NodeAttrs& attrs = n->attrs; | ||
if (dmlc::get<ActivationParam>(attrs.parsed).act_type == activation::kSoftSign) { |
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.
nit: cache act_type to avoid repeated calls ..
@nswamy @eric-haibin-lin this fixes #10868 . Please take a look. |
src/operator/nn/activation.cc
Outdated
// for ReLU, no need to pass input data. This enables inplace optimization during the | ||
// forward pass. | ||
if (dmlc::get<ActivationParam>(attrs.parsed).act_type != activation::kReLU) { | ||
if (dmlc::get<ActivationParam>(attrs.parsed).act_type != activation::kReLU && | ||
dmlc::get<ActivationParam>(attrs.parsed).act_type != activation::kSoftSign) { |
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.
nit: alignment with the line above:
if (dmlc ...
dmlc ...)
Good first blood! @samskalicky |
problem was that softsign was computed using outputs instead of inputs added inputs to list, and changed what gets passed into softsign calculation added softsign test to test_activation function code reviewed by anirudh **amended to change tab to spaces
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.
CI failures on GPU seem to be due to the fact that softsign is special cased and not supported by cuDNN. Can we fix the inputs in activation.cu
…pache#11827) * fix for bug apache#10868: _backward_softsign activation is incorrect problem was that softsign was computed using outputs instead of inputs added inputs to list, and changed what gets passed into softsign calculation added softsign test to test_activation function code reviewed by anirudh * fix for bug apache#10868: _backward_softsign activation is incorrect problem was that softsign was computed using outputs instead of inputs added inputs to list, and changed what gets passed into softsign calculation added softsign test to test_activation function code reviewed by anirudh **amended to change tab to spaces * rerunning the CI build * fixed size checks for when USE_MKLDNN=ON
…pache#11827) * fix for bug apache#10868: _backward_softsign activation is incorrect problem was that softsign was computed using outputs instead of inputs added inputs to list, and changed what gets passed into softsign calculation added softsign test to test_activation function code reviewed by anirudh * fix for bug apache#10868: _backward_softsign activation is incorrect problem was that softsign was computed using outputs instead of inputs added inputs to list, and changed what gets passed into softsign calculation added softsign test to test_activation function code reviewed by anirudh **amended to change tab to spaces * rerunning the CI build * fixed size checks for when USE_MKLDNN=ON
problem was that softsign was computed using outputs instead of inputs
added inputs to list, and changed what gets passed into softsign calculation
added softsign test to test_activation function
code reviewed by anirudh
Description
(Brief description on what this PR is about)
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments