-
Notifications
You must be signed in to change notification settings - Fork 15
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
Use SolverParameters #254
Use SolverParameters #254
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #254 +/- ##
==========================================
+ Coverage 86.66% 88.48% +1.81%
==========================================
Files 7 7
Lines 1125 1033 -92
==========================================
- Hits 975 914 -61
+ Misses 150 119 -31 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are a few minor comments. I don’t understand why the parameters should be inside the solver object?! (nevermind, I see).
0dc464c
to
cf6fd9a
Compare
It could actually, but we would need a constructor that takes both |
Would it make sense to also add (not sure how) the constraints on the parameters, for instance τ₁>0, or η1<η2 for R2. I'm thinking about MultiPrecisionR2 where there is a bunch of constraints of this kind. |
Everything regarding the constraints on the domain of the parameters should be modeled in the parameter set, the package SolverParameters.jl has a bunch of functionalities for this (even open sets). We reimplemented the Julia |
Wouldn't constraints be modeled directly in the |
Mainly yes, but some minimal constraints are also handled here. |
I noticed that |
Good point. Can you create a separate issue to do this? As you noticed this optimization is sort of new and there several parameters we didn't extract from the subsolvers. |
cf6fd9a
to
d165632
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @tmigot!
I updated a few conditions on the parameters. These changes might not be consistent with the previous version of the code, but I double checked them with the paper.
@dpo @d-monnet I finally updated this PR! The Right now constraints between the parameters are handle by an Finally, I open a PR in NLPModels.jl (JuliaSmoothOptimizers/NLPModels.jl#481) to write |
Add additional constructor Apply suggestions from code review Co-authored-by: Dominique <[email protected]>
Co-authored-by: d-monnet <[email protected]>
6eae362
to
cfadd1d
Compare
This is a first draft of integrating SolverParameters.jl in the JSO-compliant solver.
It is more constraints but clarifies the role of algorithmic parameters (their default values, and their domain -> so far we never really had a check on the domain).
I believe this structure should be in the
solver
for one reason well illustrated here that the solver can need the parameters.This is minimal change in the code as in the beginning we will extract the parameters from the solver structure.
What do change is that we can no longer call
solve!(solver, nlp, stats; with_some_parameters = 1)
with parameters. (although, we could update the values in the solver from the keyword arguments, but probably not a good practice)This also opens new perspectives. For instance, the
LbfgsParameterSet
could contains parameters for a recipe to computemem
instead of justmem
(if we plan something that depend on the size of the problem for instance).What is not done here is where we store the default values. There should be isolated, so we can modify them easily, and also they might depend on the solver precision... An optimal τ₁ (below) is probably different in
Float16
and inFloat64
.