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

Sample python bilinear initializer at integral points in y-direction #12983

Merged

Conversation

vladoovtcharov
Copy link
Contributor

Bilinear initializer was sampling at fractional points in y rather then sampling at integral points (like is done for x)

@ankkhedia
Copy link
Contributor

@vladoovtcharov Thanks for your contribution!

@mxnet-label-bot [pr-awaiting-review, Python]

@vandanavk @Roshrini @sandeep-krishnamurthy Could you please help review the PR

@marcoabreu marcoabreu added pr-awaiting-review PR is waiting for code review Python labels Oct 29, 2018
@@ -656,7 +656,7 @@ def _init_weight(self, _, arr):
c = (2 * f - 1 - f % 2) / (2. * f)
for i in range(np.prod(shape)):
x = i % shape[3]
y = (i / shape[3]) % shape[2]
y = (i // shape[3]) % shape[2]
Copy link
Member

Choose a reason for hiding this comment

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

there is a _init_bilinear method in the base Initializer class - https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/initializer.py#L212 . Is this class redundant?

Also I see that many of the initializers do not have tests. Could you please add a test for this change by creating a new file test_initializer.py in the tests folder. Tests for other initializers can be added to the same file later.

@ankkhedia
Copy link
Contributor

@sandeep-krishnamurthy Could you please label this issue as pr-awaiting-response

@sandeep-krishnamurthy sandeep-krishnamurthy added pr-awaiting-response PR is reviewed and waiting for contributor to respond and removed pr-awaiting-review PR is waiting for code review labels Oct 31, 2018
@kalyc
Copy link
Contributor

kalyc commented Nov 12, 2018

Hi @vladoovtcharov thanks for your contribution! Could you please address the comments above?

@stu1130
Copy link
Contributor

stu1130 commented Nov 21, 2018

@vladoovtcharov ping again.
let us know if you need any help!

@vladoovtcharov
Copy link
Contributor Author

vladoovtcharov commented Nov 21, 2018

_init_bilinear looks redundant and also seems to be deprecated from the comments but has the same issue so I changed that one as well.
Some initializers have tests in incubator-mxnet/tests/python/unittest/test_init.py but not bilinear I added a quick test for now

@anirudhacharya
Copy link
Member

The issue of code redundancy still remains. I am not sure about the history about this bit of code, pinging @szha to maybe help shed some light here.

@vandanavk
Copy link
Contributor

what are the next steps on this PR @vladoovtcharov @anirudhacharya @szha ?

Copy link
Member

@roywei roywei left a comment

Choose a reason for hiding this comment

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

LGTM! @vladoovtcharov thanks for the contribution, could you trigger CI by rebase or push an empty commit?

@vladoovtcharov vladoovtcharov force-pushed the patch/bilinear_init branch 3 times, most recently from 0fa8ca0 to 5e59c11 Compare December 18, 2018 05:01
@vladoovtcharov
Copy link
Contributor Author

python2 test seems to be failing (but works for python 3). I don't currently have python 2 installed but I'll try to test out soon

@vladoovtcharov
Copy link
Contributor Author

Wasn't handling division correctly in python 2. Seems to be working now

@Roshrini
Copy link
Member

Roshrini commented Jan 2, 2019

@sandeep-krishnamurthy Can you please review/merge this PR?
@mxnet-label-bot Update [Python, pr-awaiting-merge]

@marcoabreu marcoabreu added pr-awaiting-merge Review and CI is complete. Ready to Merge and removed pr-awaiting-response PR is reviewed and waiting for contributor to respond labels Jan 2, 2019
@anirudhacharya
Copy link
Member

@Roshrini can you please merge this

Copy link
Contributor

@sandeep-krishnamurthy sandeep-krishnamurthy left a comment

Choose a reason for hiding this comment

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

Thanks

@sandeep-krishnamurthy sandeep-krishnamurthy merged commit 28c20fb into apache:master Jan 26, 2019
jessr92 pushed a commit to jessr92/incubator-mxnet that referenced this pull request Jan 27, 2019
…pache#12983)

* Sample python bilinear initializer at integral points in y-direction

* Add unit test for bilinear initializer
jessr92 pushed a commit to jessr92/incubator-mxnet that referenced this pull request Jan 27, 2019
…pache#12983)

* Sample python bilinear initializer at integral points in y-direction

* Add unit test for bilinear initializer
stephenrawls pushed a commit to stephenrawls/incubator-mxnet that referenced this pull request Feb 16, 2019
…pache#12983)

* Sample python bilinear initializer at integral points in y-direction

* Add unit test for bilinear initializer
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
…pache#12983)

* Sample python bilinear initializer at integral points in y-direction

* Add unit test for bilinear initializer
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-merge Review and CI is complete. Ready to Merge Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants