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

NumPy-compatible Mean, Std and Var #16014

Merged
merged 3 commits into from
Sep 2, 2019
Merged

Conversation

haojin2
Copy link
Contributor

@haojin2 haojin2 commented Aug 27, 2019

Description

As title.

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

  • NumPy-compatible mean operator
  • Unit test

Comments

@haojin2 haojin2 added the Numpy label Aug 27, 2019
@haojin2 haojin2 requested a review from reminisce August 27, 2019 02:59
@haojin2 haojin2 requested a review from szha as a code owner August 27, 2019 02:59
@haojin2 haojin2 self-assigned this Aug 27, 2019
@haojin2 haojin2 removed the request for review from szha August 27, 2019 03:02
@reminisce
Copy link
Contributor

@marcoabreu I would like to disable test coverage build that failed in this PR. Let me know if you are not okay with it. Thanks.

@haojin2
Copy link
Contributor Author

haojin2 commented Aug 30, 2019

@marcoabreu gentle ping for feedback on disabling TEST_COVERAGE build on Clang 3.9 MKLDNN build.

@haojin2 haojin2 force-pushed the np_mean_master branch 2 times, most recently from 24db38d to c5d619a Compare August 31, 2019 02:24
@haojin2 haojin2 changed the title NumPy-compatible Mean upstream NumPy-compatible Mean, Std and Var Aug 31, 2019
@wkcn
Copy link
Member

wkcn commented Aug 31, 2019

Hi @haojin2 @reminisce , I have a question: do we need Welford algorithm to compute the variance?
"It is often useful to be able to compute the variance in a single pass, inspecting each value x_i only once"

https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance

@reminisce reminisce merged commit 5def003 into apache:master Sep 2, 2019
@haojin2
Copy link
Contributor Author

haojin2 commented Sep 2, 2019

@wkcn I think this is an interesting algorithm, I’ll revisit this later, from my perspective the current solution is an easier to understand one and also with less loss of precision. But calculating with one one pass could save some memory when the input is really large.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants