JSO-compliance definition #38
Replies: 1 comment 2 replies
-
Hi @abelsiqueira ! I think we should have a place with a detailed tutorial that goes beyond the "takes an NLP, returns a Stats", what do you think? We could do it as a JSOTutorials.jl and maybe have a template for JSO-compliant solver !? I think you have a quite complete list of what exists. The only update I would see is adding a structure for the parameters. Essentially, we wait 3 things for a JSO-compliant solver:
This behavior is tested, but maybe not extensively documented. About your suggestion of Change to solve!(stats, nlp, solver), I am fine with it. Feel free to open an issue or a PR on SolverCore and I can help propagate this. I am not too fond of storing the output inside the solver, but this is what is done in Krylov.jl. It has the merit of avoiding storing twice the solution. |
Beta Was this translation helpful? Give feedback.
-
JSO-compliant definition is currently very loose:
But we assume some additional things from our solvers, which we should include to JSO-compliance, at least as optional but desired features.
We should also define this somewhere and always link back to it. Most mentions of JSO-compliance outside of that blog don't explicitly define it.
Some formal description would be useful.
Here are some things I think are already in place:
SolverName <: SolverCore.AbstractOptimizationSolver
. Maybe more specificallySolver{T, V, ...}
, for typeT
and vector typeV
?SolverName(nlp; kwargs...)
solve!(solver, nlp, stats; kwargs...)
such that:x
,atol
,rtol
,max_eval
,max_iter
,max_time
,callback
,verbose
.callback = (nlp, solver, stats) -> nothing
is called right before the end of the loop.solver_name(nlp; kwargs...)
that callsSolverName(nlp; kwargs...)
and thensolve!(solver, nlp; kwargs...)
reset!(solver)
, which resets specific things (maybe not part of compliance)reset!(solver, nlp)
, which is also available, I think because of QuasiNewtonModels? (maybe not part of compliance)Here are some suggestions:
SolverName
should have a fieldx::V
for the iterate.solve!(stats, nlp, solver)
, since thestats
will be modified (althoughsolver
is modified too, it is not an "output", in the sense that all stored data should not be trusted).Questions/Issues:
output
insidesolver
? It is starting to feel too OOP.x
is currently stored insidesolver
andoutput
(calledsolution
there). I say we move it tooutput
only, specially sincesolve!
now requiresstats
.reset!
is only useful for the solver itself, right? Probably shouldn't be part of compliance if that is the case.solve!(stats, nlp, solver)
twice in a row (no kwargs).Beta Was this translation helpful? Give feedback.
All reactions