Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

fix for bug #10868: _backward_softsign activation is incorrect #11827

Merged
merged 21 commits into from
Jul 20, 2018

Conversation

samskalicky
Copy link
Contributor

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.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

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
Copy link
Member

@anirudh2290 anirudh2290 left a 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

const NodeAttrs& attrs = n->attrs;
if (dmlc::get<ActivationParam>(attrs.parsed).act_type == activation::kSoftSign) {
Copy link
Member

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 ..

@anirudh2290
Copy link
Member

@nswamy @eric-haibin-lin this fixes #10868 . Please take a look.

// 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) {
Copy link
Contributor

@haojin2 haojin2 Jul 19, 2018

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 ...)

@eric-haibin-lin
Copy link
Member

Good first blood! @samskalicky

Sam Skalicky added 6 commits July 19, 2018 20:13
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
Copy link
Member

@anirudh2290 anirudh2290 left a 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

@anirudh2290 anirudh2290 merged commit 95de767 into apache:master Jul 20, 2018
KellenSunderland pushed a commit to KellenSunderland/incubator-mxnet that referenced this pull request Jul 21, 2018
…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
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
…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
@lebeg lebeg mentioned this pull request Nov 20, 2018
5 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants