Skip to content
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

Fixes 2/3 of problems with Nelder Mead related traces #942

Closed
wants to merge 3 commits into from
Closed

Fixes 2/3 of problems with Nelder Mead related traces #942

wants to merge 3 commits into from

Conversation

eirikbrandsaas
Copy link
Contributor

Fixes the first two the issues raised in #941

I tried to fix the last one, but that was beyond my capabilities. If you give me a pointer I should be able to figure it out.

@codecov
Copy link

codecov bot commented Aug 12, 2021

Codecov Report

Merging #942 (ce651c1) into master (a1b957d) will increase coverage by 2.34%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #942      +/-   ##
==========================================
+ Coverage   83.60%   85.95%   +2.34%     
==========================================
  Files          42       42              
  Lines        3019     3182     +163     
==========================================
+ Hits         2524     2735     +211     
+ Misses        495      447      -48     
Impacted Files Coverage Δ
src/api.jl 85.14% <100.00%> (+23.14%) ⬆️
src/multivariate/solvers/first_order/bfgs.jl 90.66% <0.00%> (-3.46%) ⬇️
src/univariate/printing.jl 17.64% <0.00%> (-1.11%) ⬇️
src/multivariate/optimize/interface.jl 81.13% <0.00%> (-0.25%) ⬇️
src/utilities/maxdiff.jl 100.00% <0.00%> (ø)
src/univariate/solvers/brent.jl 100.00% <0.00%> (ø)
src/utilities/assess_convergence.jl 100.00% <0.00%> (ø)
src/univariate/solvers/golden_section.jl 100.00% <0.00%> (ø)
src/multivariate/solvers/first_order/cg.jl 100.00% <0.00%> (ø)
src/multivariate/solvers/first_order/l_bfgs.jl 100.00% <0.00%> (ø)
... and 23 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01b49c7...ce651c1. Read the comment docs.

@pkofod
Copy link
Member

pkofod commented Sep 20, 2021

Thanks for looking into this. It looks fine. I would appreciate if you could add a test for the missing tr thing, just to make sure that the code path is run as part of the tests.

@eirikbrandsaas
Copy link
Contributor Author

Sure, at least if you can slightly more specific on what you want. You just want me write a test that simply checks that the command works? In which of the many test/ files should it go?

@pkofod
Copy link
Member

pkofod commented Sep 30, 2021

Sure, at least if you can slightly more specific on what you want. You just want me write a test that simply checks that the command works? In which of the many test/ files should it go?

Yes, just checking that what you changed does what you intended. Here would be a good place https://github.com/JuliaNLSolvers/Optim.jl/blob/master/test/multivariate/solvers/zeroth_order/nelder_mead.jl. Just add a testset with title #942

@eirikbrandsaas
Copy link
Contributor Author

eirikbrandsaas commented Oct 6, 2021

Okay, I'll get it done sometime "soon".

EDIT: Accidentally closed it when I posted the last comment. Sorry.

@eirikbrandsaas
Copy link
Contributor Author

"Soon" became 6 months, but hey, who is counting?

I see now that you wanted me to post a separate pull request, but hope this works.

Note that, as mentioned in #941 that the stored trace is wrong, it replaces all simplex values with the last one. (That's why there are two @test_broken in the pull request.

Too see this:

using Optim
f(x) = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2
x0 = [0.0,0.0]
res = optimize(f, x0, NelderMead(),Optim.Options(store_trace=true,trace_simplex=true,extended_trace=true,iterations=2,show_trace=true))
display(res.trace)

and compare the output of the simplexes (both y-values and x-simplexes) from the "running" trace and the stored res.trace.

@eirikbrandsaas
Copy link
Contributor Author

@pkofod Just pinging.

(See comment above)

@eirikbrandsaas eirikbrandsaas closed this by deleting the head repository Sep 13, 2022
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.

2 participants