-
-
Notifications
You must be signed in to change notification settings - Fork 96
New output #113
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
New output #113
Conversation
Tried to add the uniform output (compatible with SciMLBase).
if isa(r.ls_success, Bool) && !r.ls_success | ||
failure_string *= " (line search failed)" | ||
end | ||
function build_solution(prob::AbstractNonlinearProblem, |
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.
because this is not a PR to SciMLBase, you're just shadowing and this should be SciMLBase.build_solution
. Why is this defined here?
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.
I forgot to upload the changed GalacticOptim.jl file where the build_solution is from SciMLBase. I edited it in two different places.
if isa(r.ls_success, Bool) && !r.ls_success | ||
failure_string *= " (line search failed)" | ||
end | ||
function build_solution(prob::AbstractNonlinearProblem, |
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.
function build_solution(prob::AbstractNonlinearProblem, | |
function build_solution(prob::AbstractOptimizationProblem, |
retcode, original) | ||
end | ||
|
||
function Base.show(io::IO, A::AbstractNoTimeSolution) |
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.
function Base.show(io::IO, A::AbstractNoTimeSolution) | |
function Base.show(io::IO, A::AbstractOptimizationSolution) |
@printf io "\n" | ||
@printf io " * Found with\n" | ||
@printf io " Algorithm: %s\n" r.method | ||
@printf io " Algorithm: %s\n" A.alg |
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.
@printf io " Algorithm: %s\n" A.alg | |
@printf io " Optimization Algorithm: %s\n" A.alg |
@@ -10,6 +11,7 @@ using ArrayInterface, Base.Iterators | |||
|
|||
using ForwardDiff: DEFAULT_CHUNK_THRESHOLD | |||
import DiffEqBase: OptimizationProblem, OptimizationFunction, AbstractADType | |||
import SciMLBase: AbstractNoTimeSolution, build_solution, AbstractNonlinearProblem |
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.
Correct the imports here
Superseded by #114 (because the branch here was named master... otherwise I would've just pushed the commit...). It's breaking because of the solution access change (which is tiny but still breaking downstream), so I'm calling this v1.0 because it's now inline with the rest of the SciML interfaces. We can of course continue to add more to the solution type, such as standardized ways for logging and improving the retcodes, but I think all of that should be extensions not breaking. |
Tried to add the uniform output (compatible with SciMLBase). Please ignore the old output (OptimizationSolution etc.) for now (in the respective optimizers).
My main problem is: how to overload the
build_function
withprob::OptimizationProblem
, whereOptimizationProblem
is fromDiffEqBase
.