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

Support 1D inputs in leaky relu #11850

Merged
merged 1 commit into from
Jul 22, 2018
Merged

Conversation

haojin2
Copy link
Contributor

@haojin2 haojin2 commented Jul 21, 2018

Description

Fix for #10588.

Checklist

Essentials

  • 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:https://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

  • Fix for handling 1D inputs in leaky_relu
  • Added test coverage for input ndim from 1-4

Comments

Unit test passed 10000 trials on both CPU & GPU

@haojin2
Copy link
Contributor Author

haojin2 commented Jul 21, 2018

@reminisce @anirudh2290

@@ -748,7 +748,8 @@ def fleaky_relu_grad(grad, x, y, act_type, slope=0.25):
elif act_type == 'leaky':
out[neg_indices] = slope
return out * grad
shape = (3, 4)
ndim = random.randint(1, 4)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about a for loop rather than random ndim, it's not guaranteed 1D data is used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, done.

@zhreshold zhreshold merged commit 65fee98 into apache:master Jul 22, 2018
@haojin2 haojin2 deleted the leaky_relu_1d branch July 22, 2018 20:12
XinYao1994 pushed a commit to XinYao1994/incubator-mxnet that referenced this pull request Aug 29, 2018
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

2 participants