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

Allow users to create stopping criteria #91

Open
stefan-k opened this issue Jan 17, 2021 · 2 comments
Open

Allow users to create stopping criteria #91

stefan-k opened this issue Jan 17, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@stefan-k
Copy link
Member

Currently, stopping criteria are defined during the implementation of the solver. However, sometimes it might be useful if users could add their own stopping criteria. This would require a complete redesign of how termination works. One of the key aspects of termination is that it needs access to the fields of the solver which makes it difficult to implement in a generic way. However, similar to how observers work, the needed variables could be stored in a key-value store and passed to the user-defined termination function. It needs to be evaluated how efficient such an approach would be.

@stefan-k stefan-k added the enhancement New feature or request label Jan 17, 2021
@KSchmidAmilar
Copy link

We've had success with writing our own execution loop based on the code in Executor.run(). This gives us more fine-grained control over termination criteria. This approach is similar to the api for libgsl. Perhaps eliminating the Executor and allowing the user to write the loop would achieve this customizability.

@stefan-k
Copy link
Member Author

I was planning to approach this the same way as it is done for observers. A list of (user-defined) stopping criteria (defined by a trait) can be attached to an Executor, which will all be evaluated in each iteration. A stopping criteria has access to the current state (and maybe the key-value metrics which are passed to the observers). The question remains how to get access to the fields of the solver, but maybe this isn't really needed.

These stopping criteria would be in addition to the stopping criteria implemented in the respective solver.

Would you require more flexibility than that?

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

2 participants