You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line (np.abs(old_cost) if old_cost != 0.0 else 1e-20) could also be max(np.abs(old_cost), 1e-20) to make sure it also works if 0 < np.abs(old_cost) < 1e-20
That line is only to avoid a division by zero, so the 1e-20 is only used when old_cost is exactly 0.0. If the tuning objective is meaningfully trying to optimize tiny values and 1e-20 would be 'higher' than the real objective values this could indeed lead to strange decision making. However, having actual objective values in that range with Kernel Tuner seems unlikely and it would still be extremely rare as this is only triggered when the returned cost is exactly 0.0.
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
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.
Fixes the warning as mentioned in #362.
Also solves a possible division by zero in simulated annealing.