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

Improve error handling #8

Merged
merged 10 commits into from
Jan 16, 2024
Merged

Improve error handling #8

merged 10 commits into from
Jan 16, 2024

Conversation

timmens
Copy link
Member

@timmens timmens commented Jan 14, 2024

This PR's goal is to run tranquilo on the More and Wild benchmark set without raising any errors.

More broadly, we want that

  • Any invalid return (or exception) of the criterion functions is intercepted and replaced with infinity
  • Any appearance of infinity is handled correctly

For this, I

  1. Set function evaluations that raise an exception to infinity in the wrapped criterion function

  2. Check that the candidate point of the acceptance step is valid (does not correspond to a criterion value of infinity), and otherwise return the current best point and a rho of negative infinity

  3. Add error handling around the subsolvers by adding a fallback solver that is activated if the regular subsolver raises an exception. Currently, implemented fallback options are:
    Sphere

    • SLSQP with a nonlinear constraint corresponding to $|| x || \leq 1$
    • L-BFGS-B with a box constraint equal to the largest box inscribed in the unit sphere
    • L-BFGS-B with parametrization (project $x$ onto the sphere hull if $||x|| > 1$)

    Cube

    • L-BFGS-B with a box constraint $-1 \leq x \leq 1$
    • L-BFGS-B with a box constraint in a multistart framework

Additionally, I

  1. Skip the poisedness tests on windows, as they are instable and not used currently.

Copy link

codecov bot commented Jan 14, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (7042550) 77.91% compared to head (398d14b) 78.48%.

Files Patch % Lines
src/tranquilo/acceptance_decision.py 44.44% 5 Missing ⚠️
src/tranquilo/solve_subproblem.py 73.33% 4 Missing ⚠️
src/tranquilo/subsolvers/fallback_subsolvers.py 98.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
+ Coverage   77.91%   78.48%   +0.57%     
==========================================
  Files          68       68              
  Lines        4881     4923      +42     
==========================================
+ Hits         3803     3864      +61     
+ Misses       1078     1059      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timmens timmens merged commit a94c8b5 into main Jan 16, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants