JuliaNLSolvers / Optim.jl

Optimization functions for Julia
Other
1.12k stars 217 forks source link

Typo on Optim.simplexer() function #1064

Closed gaston-fernandez closed 8 months ago

gaston-fernandez commented 8 months ago

Hi

There is a small typo on the function you provided to implement the initial simplex as in Matlab's fminsearch in the Nelder-Mead algorithm, in section "Specifying the initial simplex".

You defined the function:

function Optim.simplexer(A::MatlabSimplexer, initial_x::AbstractArray{T, N}) where {T, N}
    ...    
    for j = 1:n
        initial_simplex[j+1][j] += initial_simplex[j+1][j] == zero(T) ? S.b * initial_simplex[j+1][j] : S.a
    end
    ...
end

The typo is on the first argument of Optim.simplexer(): the first argument should be S::MatlabSimplexer.

pkofod commented 8 months ago

Oh, the S. Good catch. Thanks

pkofod commented 8 months ago

Wait, looking at the code this is actually correct and I havn't touched that file for four years. I wonder if the docs are not generated as they should on new tags.

pkofod commented 8 months ago

See this https://github.com/JuliaNLSolvers/Optim.jl/pull/819

pkofod commented 8 months ago

So it's correct on dev docs now after it built, but it looks like I have some cleaning up to do as the old docs code used a very old version of documenter https://julianlsolvers.github.io/Optim.jl/dev/algo/nelder_mead/

pkofod commented 8 months ago

docs are now running