Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce tolerances in benchmark model gradient checks #2511

Open
dweindl opened this issue Sep 27, 2024 · 2 comments
Open

Reduce tolerances in benchmark model gradient checks #2511

dweindl opened this issue Sep 27, 2024 · 2 comments
Labels

Comments

@dweindl
Copy link
Member

dweindl commented Sep 27, 2024

The current tolerances are huge:

# Absolute and relative tolerances for finite difference gradient checks.
ATOL: float = 1e-3
RTOL: float = 1e-2

@dweindl
Copy link
Member Author

dweindl commented Sep 30, 2024

Worse... failed gradient checks would not have been reported at all. success is type fiddy.derivative_check.DerivativeCheckResult.

success = check(rtol=RTOL, atol=ATOL)

We need to check the success attribute, not the full object here:

assert success, derivative.df

dweindl added a commit that referenced this issue Oct 2, 2024
* Fix gradient checks. Previously, failing test would not have been reported (see #2511).
  Quite some tests are now skipped, but better to test some than none... To be re-enabled later.
* Sort test cases to avoid issues with pytest-xdist.
* Refactor

Requires ICB-DCM/fiddy#37
@dweindl
Copy link
Member Author

dweindl commented Oct 8, 2024

For Blasi_CellSystems2016 (nothing special in the model, except for post-equilibration), adjoints are so far off, that I think there is something wrong ...

pretty good: tests/benchmark-models/test_petab_benchmark.py::test_benchmark_gradient[Blasi_CellSystems2016-forward-scaled]
pretty bad: tests/benchmark-models/test_petab_benchmark.py::test_benchmark_gradient[Blasi_CellSystems2016-adjoint-scaled]

EDIT: The problem is SteadyStateSensitivityMode.integrateIfNewtonFails. With ASA, this fails badly here. SteadyStateSensitivityMode.integrationOnly works.

dweindl added a commit that referenced this issue Oct 9, 2024
…ck output (#2524)

* Make the result more informative and more readable.
* Re-enable some test problems, use stricter tolerances for some at least (#2511) 
* More problem-specific settings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant