Skip to content

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

Closed
wants to merge 2 commits into from
Closed

New output #113

wants to merge 2 commits into from

Conversation

mkg33
Copy link
Contributor

@mkg33 mkg33 commented Feb 21, 2021

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 with prob::OptimizationProblem, where OptimizationProblem is from DiffEqBase.

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,
Copy link
Member

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?

Copy link
Contributor Author

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function build_solution(prob::AbstractNonlinearProblem,
function build_solution(prob::AbstractOptimizationProblem,

retcode, original)
end

function Base.show(io::IO, A::AbstractNoTimeSolution)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the imports here

@ChrisRackauckas
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants