-
Notifications
You must be signed in to change notification settings - Fork 18
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
Handling crashes while optimizing #31
Comments
I assume you mean that the objective function you provide as an input to Py-BOBYQA sometimes crashes for particular parameter combinations? Py-BOBYQA doesn't have the ability to explicitly handle nan/error values, so the best option when a crash occurs would be to return a large function value (e.g. at least 1 order of magnitude larger than the objective value at nearby points). That way, Py-BOBYQA will never return these parameters as a solution, and it will try to search for a solution away from parameter combinations close to where the crash occurred. |
In that case my objective function should have access to the solution history, how should I do that? I could access the logging string and parse the evaluations but that solution is subpar imho. Is there a better way? |
You can either just pick a moderately large value arbitrarily, from just observing your problem in a few runs. Otherwise, you can wrap your function in a class which saves the values you've seen, something like:
|
Which is the best strategy to handle a model crashing upon evaluation while optimizing input parameters?
The text was updated successfully, but these errors were encountered: