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

Add stopping criteria based on the number of function evaluations #417

Open
stefan-k opened this issue Jan 25, 2024 · 2 comments
Open

Add stopping criteria based on the number of function evaluations #417

stefan-k opened this issue Jan 25, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@stefan-k
Copy link
Member

"Functions" in this context are calls to methods of the traits CostFunction, Gradient, Hessian, Jacobian, Operator, but also solver-specific ones such as Anneal (Simulated Annealing). Furthermore it includes user-created functions which we do not know about yet.

I think it should be possible to limit the total number of evaluations (all function evaluations summed up), as well as limiting the number of calls to individual functions. Ideally, users can also decide which subset of functions they think should be considered.

To be consistent with how the max_iters limit works, the information which function calls should be limited how, should probably also reside in the state (IterState, PopulationState) and access to them is probably via the State trait. The actual check should probably be performed in Executor after every iteration. However, that may cause the actual number of evaluations to exceed the set limit.
Alternatively it may be possible to include this into the Problem struct, by informing the solver if the limit is exceeded, but I'm afraid that this will cause too much code that is difficult to maintain. If implementing this requires changes to the individual solver implementations, then it is certainly the wrong path.

@stefan-k stefan-k added good first issue Good for newcomers enhancement New feature or request labels Jan 25, 2024
@soumyasen1809
Copy link

@stefan-k Hi, I am new to Rust and would like to take a shot at this item. Is it still possible to work on this?

@stefan-k
Copy link
Member Author

@soumyasen1809 sure! However, I'm afraid this will require quite a bit of architectural work which I would like to take a close look at. Unfortunately I'm quite busy lately and my response times are high. You're very welcome to take a shot at this, but it may require some patience on your side as I won't be able to respond very quickly.

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

No branches or pull requests

2 participants