-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scaling-dependence of termination criterion
The termination criterion for bisecting alpha implicitly assumes the optimal alpha to be in the order of magnitude of 1.0. For larger values of alpha, lower and upper can never get close enough, meaning the bisection never terminates successfully. For smaller values of alpha, the bisection may terminate much too early. This fixes that by checking the relative instead of the absolute difference using numpy.isclose. Also, this adds tests with a large and a tiny optimal alpha that would have failed with the previous termination criterion (they also wouldve failed for much more moderate scaling factors like 100).
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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