Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Oct 9, 2024
1 parent 40cc87d commit cb7505d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tests/benchmark-models/test_petab_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class GradientCheckSettings:
rtol_sim=1e-14,
noise_level=0.01,
)
settings["Okuonghae_ChaosSolitonsFractals2020"].step_sizes.insert(0, 0.2)
settings["Okuonghae_ChaosSolitonsFractals2020"].step_sizes.extend([0.2, 0.005])
settings["Oliveira_NatCommun2021"] = GradientCheckSettings(
# Avoid "root after reinitialization"
atol_sim=1e-12,
Expand All @@ -107,6 +107,7 @@ class GradientCheckSettings:
rtol_sim=1e-12,
atol_check=1e-5,
rtol_check=1e-4,
rng_seed=7,
)
settings["Weber_BMC2015"] = GradientCheckSettings(
atol_sim=1e-12,
Expand Down Expand Up @@ -291,16 +292,12 @@ def assert_gradient_check_success(
with pd.option_context("display.max_columns", None, "display.width", None):
message = (
f"Gradient check failed:\n{df}\n\n"
f"Maximum absolute difference: {max_adiff}\n"
f"Maximum relative difference: {max_rdiff}"
f"Maximum absolute difference: {max_adiff} (tolerance: {atol})\n"
f"Maximum relative difference: {max_rdiff} (tolerance: {rtol})"
)

if check_result.success is False:
raise AssertionError(
f"Gradient check failed:\n{df}\n\n"
f"Maximum absolute difference: {max_adiff}\n"
f"Maximum relative difference: {max_rdiff}"
)
raise AssertionError(message)

if always_print:
print(message)
Expand Down

0 comments on commit cb7505d

Please sign in to comment.