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

Exception handling in function evaluation #39

Closed
krzysztofarendt opened this issue Feb 9, 2021 · 3 comments
Closed

Exception handling in function evaluation #39

krzysztofarendt opened this issue Feb 9, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@krzysztofarendt
Copy link
Owner

We cannot guarantee that the cost function will work for the entire range of parameters. In example in ModestPy FMU solvers sometimes fail when unphysical parameters are used (see: sdu-cfei/modest-py#68).

It should be fairly easy to implement some generic exception handling. I think it is sufficient to enclose the following line with a try... except... block:

self.val = self.fun(self.get_estimates(), *self.args)

When exception is caught the function value could be +infinity or some very large number.

@krzysztofarendt
Copy link
Owner Author

Feature added in: #42

@krzysztofarendt
Copy link
Owner Author

Ready for testing.

@krzysztofarendt
Copy link
Owner Author

Seems it works with the new fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant