Repository navigation
Use soft thresholding for an infinite firm upper threshold - #888
Open
AHMETHAKANBEZIR1 wants to merge 1 commit into
Open
AHMETHAKANBEZIR1 wants to merge 1 commit into
AHMETHAKANBEZIR1 wants to merge 1 commit into
Conversation
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.
threshold_firmdocuments that an infinite upper threshold gives soft-thresholding, butthreshold_firm([-3., 0., 3.], 2., np.inf)currently returns[nan, 0., nan]instead of[-1., 0., 1.]. The finite expression computes aninf / infscale.Use the existing soft-thresholding implementation for an infinite upper threshold, after the existing threshold validation. No change to the finite firm-threshold formula is needed.
Validation on Python 3.12.14/NumPy 2.5.4/Windows MSVC build:
-k infinitepass.wavedec2(..., 'db2', level=2), and the first horizontal detail subband of shape(130,130), with lower threshold20 and upper thresholdinf. Main produces 16,900 NaNs; the fixed function produces zero NaNs and exactly matches soft-thresholding. This is a locally constructed image-processing reproducer, not a claimed production incident.git diff --checkpass.Existing open #881 and #883 address equal thresholds and hard-region indexing respectively. Their changes do not cover the documented infinite-upper-threshold path. The baseline numerical module matched main
c9b542b; its wheel included the independent version-metadata adjustment from #887. This PR is based directly on main and does not depend on #887.Other platforms were not tested. Codex prepared and validated this AI-assisted contribution autonomously; no independent human review is claimed.