DM-48920: Handle NaNs in variance values when creating templates#383
Merged
arunkannawadi merged 6 commits intomainfrom Mar 5, 2025
Merged
DM-48920: Handle NaNs in variance values when creating templates#383arunkannawadi merged 6 commits intomainfrom
arunkannawadi merged 6 commits intomainfrom
Conversation
438e066 to
8ba89c2
Compare
ebellm
approved these changes
Feb 20, 2025
0f49013 to
8ee0d31
Compare
8ee0d31 to
ebf96ea
Compare
Having NaN values in the weight that multiplies images is bad, since a single bad image can ruin a pixel regardless of other inputs. Since we are setting its corresponding weight to be zero, we kill its image (and variance) values also by multiplying by zero.
In case the variance plane has zeros resulting in inf values in weight, that needs to be cleared out as well. Instead of mapping only NaN values to zero, we mapping non-finite values to zero more generally.
It is inconsistent to set quantities to zero, and not guard against division by the same quantities. Right before the division, we map zeros to inf, so the image and variance values of those pixels are zeros. We also set NO_DATA mask bit when that happens.
This unit test mimics a condition that triggered DM-48920.
These additional changes address more of the divide by zero and NaN warnings
ebf96ea to
40dcd7f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.