Repository navigation
Don't require the error estimate to be small relative to the value - #88
Merged
Merged
Conversation
dweindl
marked this pull request as ready for review
October 21, 2026 19:25
dilpath
approved these changes
Oct 26, 2026
A direction was classified "converged" only if its error estimate was also at most half the absolute value. For a derivative that is zero or close to it, this fails even when the error estimate is far below the tolerance, so such directions were reported as `noise_dominated`, and gradient checks were inconclusive for them. Yet `value +- error_estimate` still bounds the derivative's magnitude, which is what a gradient check needs. "converged" now only requires the error estimate to be within the (default or user-supplied) tolerance. Whether the value is distinguishable from zero is available as the new `DerivativeEstimate.resolved` (`|value| > 2 * error_estimate`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dweindl
force-pushed
the
converged-absolute-precision
branch
from
October 26, 2026 19:13
6142836 to
29aaa2b
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.
A direction was classified
convergedonly if its error estimate was also at most half the absolute value. For a derivative that is zero or close to it, this fails even when the error estimate is far below the tolerance. Such directions were reported asnoise_dominated, and gradient checks were inconclusive for them. However,value ± error_estimatestill bounds the derivative's magnitude, which is all a gradient check needs: a wrongly nonzero analytical derivative is caught.Now
convergedonly requires the error estimate to be within the (default or user-supplied) tolerance. Whether the value is distinguishable from zero (i.e. whether its sign and relative size mean anything) is available as the newDerivativeEstimate.resolved(|value| > 2 * error_estimate). This also removes status flips between runs for directions with|value| ≈ 2 * error_estimate.The notebook's "Solution 4" is updated accordingly. Its example (true derivative 9.2e-9, estimate 4.5e-6 ± 1.9e-5) is now
convergedand notresolved; the true value is well within the error bar.Evaluated by replaying the AMICI SBML semantic test suite and benchmark collection results (CI dumps from both Ubuntu 24.04 and 26.04, with and without #87):
noise_dominatedones) failed only the relative check; nearly all of them are derivatives that are zero up to rounding. Their error estimates are small (median 0.8% oftol) and cover the deviation from AMICI's sensitivities at least as well as those of converged directions do.converged, all of them pass their gradient check; none fails. Same for the ~130–140 such directions in the benchmark collection.🤖 Generated with Claude Code