Fix all open issues: #69, #70, #71 - #72
Merged
Merged
Conversation
- Issue #69: Replace unstable sinh with stable difference-of-exponentials in UnderdampedOscillatorKernel for zeta >= 1 - Issue #71: Guard log10(0) in compute_detailed_metrics with a small positive floor - Issue #70: Expose Bayesian optimization budget (n_calls, n_initial_points) and add fast_mode flag to speed up lti_system_gen All 69 tests pass; black, ruff, codespell, and mypy all clean. Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
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.
Summary
Fixes all three open issues and makes the CI green.
Issue #69 — UnderdampedOscillatorKernel overflow for zeta >= 1
modpods/kernels.py: Replaced the unstablesinh(s*t)formulation in the overdamped branch with a stable difference-of-exponentials form. Forzeta > 1both exponents are negative, so no overflow occurs. The limiting casezeta -> 1is also handled correctly.Issue #71 — metrics.py crashes on zero predictions due to log10(0)
modpods/metrics.py: Refactoredcompute_detailed_metricsto use a_log10_sortedhelper that clips sorted values to a small positive floor (1e-12) beforenp.log10. The FDC denominator is also guarded against zero. Zero/negative predictions no longer produce-inf/NaNmetrics.Issue #70 — lti_system_gen is extraordinarily slow for realistic problems
modpods/train.py: Exposed the Bayesian optimization budget (n_calls,n_initial_points) as overrideable optimizer kwargs, so users can trade accuracy for speed.modpods/train.py: Added afast_modeflag toSingleKernelTrainer,MultiKernelTrainer, anddelay_io_trainthat:max_iter // 10,popsize 5)max_transformsat 2 (sufficient for most physical systems)differential_evolutioninstead of Bayesian optimizationmodpods/lti.py/modpods/estimator.py: Addedfast_modeandoptimizer_kwargsparameters tolti_system_gen,LTISystem, andDelayIOfor consistency.modpods/train.py: Fixed pre-existing mypy errors ondifferential_evolutioncalls.Verification
fast_mode=Truereduces the issue lti_system_gen is extraordinarily slow for realistic problems #70 repro from ~270s to ~2s