Repository navigation
Conversation
At the default tolerances, the finite differences' own solver error exceeds the check tolerance. This went unnoticed because fiddy's noise probe mistook the solver error for noise and widened the tolerance (ICB-DCM/fiddy#93). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The adjoint gradient is a quadrature with a default relative tolerance of 1e-8, independent of the state tolerances. This limited the accuracy of the adjoint gradients in `test_presim_event_outputs` and the benchmark gradient checks (SalazarCavazos_MBoC2020, Blasi_CellSystems2016) to ~1e-8, the default `rtol` of the fiddy checks. A relative quadrature tolerance of 1e-10 suffices; tying it to the state tolerances (1e-12..1e-15) increased the number of backward steps up to 7-fold for some benchmark models. Also simulate Blasi_CellSystems2016 at `rtol` 1e-13, as the finite differences at 1e-12 were not accurate enough for the scaled gradient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3588 +/- ##
==========================================
- Coverage 80.75% 80.72% -0.04%
==========================================
Files 331 331
Lines 23699 23699
Branches 1674 1675 +1
==========================================
- Hits 19139 19131 -8
- Misses 4554 4562 +8
Partials 6 6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Tighten the solver tolerances in some gradient checks, so that they no longer rely on fiddy overestimating the solver noise.
ICB-DCM/fiddy#96 makes fiddy's noise-floor probe robust to nearby jumps. In several checks, the estimated noise floor, and with it the check tolerance, becomes smaller and no longer covers the actual solver error:
test_fiddy.py: at the default solver tolerances, the solver error of the finite differences exceeds the check tolerance. Nowrtol1e-12,atol1e-15.set_relative_tolerancedoes not change. This limits the accuracy of adjoint gradients to ~1e-8, fiddy's default checkrtol(failures:test_presim_event_outputson Windows, SalazarCavazos_MBoC2020 and Blasi_CellSystems2016 unscaled). The adjoint gradient checks now use a relative quadrature tolerance of 1e-10. In the benchmark gradient checks, this increases the number of backward steps by at most 1.3x; tying the quadrature tolerances to the state tolerances would increase it up to 7x.rtol1e-13, as the finite differences at 1e-12 are not accurate enough.Validated with ICB-DCM/fiddy#96 on a fork branch. Since AMICI installs fiddy from
main, this should be merged before ICB-DCM/fiddy#96. The related change for SBML test case 01395 goes to #3577.Relates to ICB-DCM/fiddy#93.
🤖 Generated with Claude Code