-
Notifications
You must be signed in to change notification settings - Fork 33
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 "xtol" and "ftol" stopping criteria for optimisers #1502
Comments
I'm happy with those proposals, doing absolute ones makes more sense as relative would presumably be with respect to initial guess or something which would be a bit strange to vary run to run. Haven't ever seen a package specify a vector of xtol, but it makes sense, maybe I have just been automatically doing I think matlab's Although, the matlab optimisation toolbox itself has a different optimoptions which gets the options for a particular optimiser, they seem to more commonly use
|
OK, so with our |
@mirams @martinjrobins @chonlei discussion point: The Options:
Input from anyone else doing optimisation appreciated! |
There is a case for having both I think, if you want to use the |
I am not too sure. For option 3, it is like having an alias to |
Yeah, an argument for just wrapping, so I think confusion could then arise if the user can call both, but perhaps not, might even be a good idea to be able to set a collection of these like
and stop the first time one is met!! But it is a bit crazy. |
No we ignore what the optimisers say so that we can use the same controller to run optimisations with them! They use different number of evaluations per iteration, that's fine :D To clarify the "who implements what" thing a bit further:
|
That's an interesting idea! Would require some laborious unsetting syntax though, e.g. Will leave that for now as we don't have a direct use case :D |
But both leaning towards option 2 then? |
Alright, will add a |
|
Many implemented optimisers provide stopping criteria based on the difference between the last two parameter sets (
abs(x[i] - x[i - 1]
) or the last two function evaluations (abs(f[i] - f[i - 1])
). When comparing methods from PINTS with other methods, it is useful to have something similar.How do people define xtol and ftol?
Absolute versus relative
Occasionally, relative differences are used, e.g.
abs(f[i] - f[i - 1]) / f[i]
.Scalar xtol?
In nlopt, xtol can be a scalar, in matlab it looks like it needs to have size
n_parameters
.AND vs OR
In scipy's Nelder-mead, xtol AND ftol must be met. Everywhere else they are independent stopping criteria https://stackoverflow.com/questions/43644797/what-is-xtol-for-in-minimizemethod-nelder-mead
Proposal
set_xtol(generic_tol)
instead ofset_xtol(abs_tol / sensible_scaling_value)
. I propose we do absolute only, leaving scaling to the user (who has the info needed for this decision)set_xtol(tol)
instead ofset_xtol([tol] * n_parameters)
. So xtol always n_parameters, ftol always scalar.Both matlab and scipy seem to be phasing out the "xtol"/"ftol" terminology (i.e. scipy is using xatol/ratol when relative, matlab is saying "StepTolerance"/"FunctionTolerance", so might follow that and
set_step_tolerance
andset_function_tolerance
. The current names aremax_iterations
,max_evaluations
,max_unchanged_iterations
, andthreshold
(stop iff < threshold
). So could haveset_step_tolerance
andset_tolerance
instead? Orset_min_step
andset_min_change
?The text was updated successfully, but these errors were encountered: