Optimization.jl icon indicating copy to clipboard operation
Optimization.jl copied to clipboard

Uniform solution type

Open ChrisRackauckas opened this issue 4 years ago • 1 comments

In the SciML interfaces, all problems and solutions live in SciMLBase (as of... yesterday 😄).

They satisfy the solution interface too:

https://github.com/SciML/SciMLBase.jl/blob/master/src/solutions/solution_interface.jl

I think we should get this return type into there, and make it follow the results of the other solutions, namely:

  1. The return array is named u: that would be the minimizer here. To be non-breaking it could be good to alias .minimizer to .u with a getproperty overload.
  2. We can have a special .minimum
  3. It should have overloads to the build_solution function
  4. It can have .original for keeping the original output struct of the other optimizers
  5. It should be an AbstractNoTimeSolution?
  6. It might want special overloads to printing and such, but follow the same general flow.
  7. It should interpret things into the standard retcodes.
  8. Matching the ODE solver, stuff like iterations might make sense in a .stats OptimizationStatistics.

So I think a lot of https://github.com/SciML/GalacticOptim.jl/blob/master/src/solve.jl#L2-L28 should be copied over to be the basis of this change, but just a few tweaks to bring it in line with the more general AbstractSolution interface.

ChrisRackauckas avatar Jan 29 '21 06:01 ChrisRackauckas

Thanks for the concrete list! I especially like the idea with .original because there are quite a few interesting details in the original output (in some cases).

mkg33 avatar Jan 29 '21 06:01 mkg33