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

add infer_type for regression ops, fix issues#9847 #9848

Merged
merged 2 commits into from
Feb 27, 2018
Merged

add infer_type for regression ops, fix issues#9847 #9848

merged 2 commits into from
Feb 27, 2018

Conversation

ZiyueHuang
Copy link
Member

Description

fix #9847

Checklist

Essentials

  • Passed code style checking (make lint)
  • 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
  • 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

@ZiyueHuang ZiyueHuang changed the title add infer_type for regression ops, fix https://github.com/apache/incubator-mxnet/issues/9847 add infer_type for regression ops, fix issues#9847 Feb 21, 2018
@cjolivier01
Copy link
Member

How did unit test test_operator.py test_regression() test work without the error?

@marcoabreu
Copy link
Contributor

Yes, please track down why the test did not catch this issue

@ZiyueHuang
Copy link
Member Author

Unittest is written in symbolic mode while the issue is in imperative mode. In symbolic mode, infer_type pass has a default infer function SameType https://github.com/apache/incubator-mxnet/blob/master/src/executor/infer_graph_attr_pass.cc#L403-L408, but in imperative mode, there is no default infer type function https://github.com/apache/incubator-mxnet/blob/master/src/imperative/imperative_utils.h#L123. So this is an inconsistent behaviour between symbolic mode and imperative mode. Should we correct it? cc @reminisce @eric-haibin-lin

@ZiyueHuang
Copy link
Member Author

By the way, L2NormalizationOp and InstanceNormOp don't have an infer_type function.

@cjolivier01
Copy link
Member

Makes sense.

@marcoabreu
Copy link
Contributor

Very nice catch, @ZiyueHuang! Sounds like a good idea.

@cjolivier01
Copy link
Member

Please feel free to add infer type for the other ones if you like (not required for this PR, however).

@ZiyueHuang
Copy link
Member Author

Is this good to merge? @piiswrong

@eric-haibin-lin
Copy link
Member

@piiswrong any special reason for missing default inference function in imperative mode?

@piiswrong piiswrong merged commit 34af930 into apache:master Feb 27, 2018
@piiswrong
Copy link
Contributor

We can add a default for imperative later

@ZiyueHuang ZiyueHuang deleted the reg_type branch May 3, 2018 15:29
rahul003 pushed a commit to rahul003/mxnet that referenced this pull request Jun 4, 2018
* add infer_type for regression ops

* trigger CI
zheng-da pushed a commit to zheng-da/incubator-mxnet that referenced this pull request Jun 28, 2018
* add infer_type for regression ops

* trigger CI
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.

Imperative regression output layers are broken
5 participants