Commit c7f7f36
Resizing layer unit test assertion line length exceeded refactored (#58)
* Implementation of preprocessing image resizing layer
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) <[email protected]>
Co-authored-by: Brian Zheng (@Brianzheng123) <[email protected]>
* Updating image preprocessing test file to include approved usage of CodeSmith licensing header
* refactored interpolation type declaration
* minor spacing correction
* resizing layer test assertion statement argument casting refactored
* image resizing layer unit test assertion line max length exceeded refactored
Co-authored-by: Adam Lang (@AdamLang96) <[email protected]>
Co-authored-by: Brian Zheng (@Brianzheng123) <[email protected]>1 parent 641c3a6 commit c7f7f36
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
0 commit comments