NRCan / geo-deep-learning

Deep learning applied to georeferenced datasets
https://geo-deep-learning.readthedocs.io/en/latest/
MIT License
150 stars 49 forks source link

BUG: scale to minmax range #562

Closed valhassan closed 1 month ago

valhassan commented 3 months ago

Describe the bug The original min and max ranges are inferred from the array in this function. The correct case is to provide the range as parameters to avoid floating point errors "Expected: (0, 1) Actual: (-4.768371586472142e-09, 1.0000000190734863)"

https://github.com/NRCan/geo-deep-learning/blob/c4d4b75a58c51283db088421d16fe969e9929b74/utils/utils.py#L202-L220

To Reproduce Steps to reproduce the behavior:

  1. Test the function with an array of high-precision floating points that exceed the expected range (0, 1)

Expected behavior The function should scale based on the provided parameters and shift from dynamic to static scaling.

Screenshots NULL

Additional context NULL