fix(deficiency): interpolate between severity matrices#274
Open
spokodev wants to merge 1 commit into
Open
Conversation
The interpolation weight was computed with Math.round on the sub-step remainder, which is always zero, so the blend between neighboring matrices never ran and the severity snapped to the nearest tabulated step. Map severity onto the matrix index and use the fractional part as the blend weight.
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.
filterDeficiency*documents a continuousseverityin[0, 1]and the code has a blend between the Machado 0.1-step matrices, but the blend was dead code so severity snapped to the nearest tabulated step.Math.round(tt % 0.1)is always 0 becausett % 0.1is in[0, 0.1), so the interpolation branch never ran. Severities in[0, 0.05)produced the identity (no effect), and0.05to0.14all equaled the0.1matrix.This computes the matrix index and blend weight with
floorand the fractional part, so adjacent matrices are interpolated as intended. Endpoints and the documented0.5example are unchanged. The one existing0.55snapshot encoded the previous snapped output and is updated to the interpolated values; a new test asserts the halfway blend at severity0.05.