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

Scala/Java Predict API fix #14756 #14804

Merged
merged 3 commits into from
Apr 27, 2019
Merged

Conversation

lanking520
Copy link
Member

@lanking520 lanking520 commented Apr 25, 2019

Description

A bug are being identifed that the concatenation process applied on the predict is incorrect. This PR is a fix on that #14756.
@zachgk @gigasquid @yzhliu @androuino

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

@@ -264,7 +276,8 @@ abstract class BaseModule {
s"in mini-batches (${out.size})." +
"Maybe bucketing is used?")
)
val concatenatedOutput = outputBatches.map(out => NDArray.concatenate(out))
val oBT = outputBatches.transpose
val concatenatedOutput = oBT.map(out => NDArray.concatenate(out))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you also need to dispose oBT here ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This create a soft copy, the content inside contains same reference

Copy link
Member

@gigasquid gigasquid left a comment

Choose a reason for hiding this comment

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

I checked it with the Clojure package's use of predict and everything works 👍

@lanking520 lanking520 merged commit 6cbc273 into apache:master Apr 27, 2019
lanking520 added a commit to lanking520/incubator-mxnet that referenced this pull request Apr 29, 2019
* add fix in the code

* add unit test

* update comments
lanking520 added a commit that referenced this pull request Apr 29, 2019
* clean up submodule (#14645)

* Scala/Java Predict API fix #14756 (#14804)

* add fix in the code

* add unit test

* update comments

* add fixes to code gen
access2rohit pushed a commit to access2rohit/incubator-mxnet that referenced this pull request May 14, 2019
* add fix in the code

* add unit test

* update comments
@lanking520 lanking520 deleted the java-predict-fix branch June 21, 2019 22:11
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* add fix in the code

* add unit test

* update comments
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

5 participants