Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing layer unit test assertion argument casting error refactored #57

Merged
merged 9 commits into from
Oct 7, 2022

Conversation

koyykdy
Copy link

@koyykdy koyykdy commented Oct 7, 2022

To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.

koyykdy and others added 9 commits September 29, 2022 11:42
Important Note:
The lower-level op implementation of image resizing-nearest neighbor in TensorFlow.js differs from the implementation of the comparable op in Keras-Python.

While the Python version of the op function always selects the bottom right cell of the sub-matrix to be used as the representative value of that region in the downscaled matrix, the JavaScript implementation defaults to the top left cell of the sub-matrix, and then preferentially shifts to the right side of the sub-matrix in all sub-matrices past the lateral halfway point ( calculated by floor((length-1)/2) ), and the bottom side of the sub-matrix in all sub-matrices past the vertical halfway point, when considering the top-left side of the parent matrix as the origin.

This causes a slight variation in the output values from nearest neighbor downscaling between the Python and JavaScript versions of the code as it currently stands, and the unit tests for the resizing layer has been implemented to reflect this difference in op-function behavior.

Co-authored-by: Adam Lang (@AdamLang96) <adamglang96@gmail.com>
Co-authored-by: Brian Zheng (@Brianzheng123) <brianzheng345@gmail.com>
@koyykdy koyykdy merged commit 641c3a6 into CodeSmithDSMLProjects:resizing Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant