Closed mateuszbaran closed 1 year ago
Hm Nelder Mead. That is a strange algorithm and it might be hard to get the right default values. If I read that correctly we use the 4 default values from the paper of Nelder&Mead, while the default in Optim is more advanced and changes during the iterations (that is not possible or would require some implementation).
So I would only speak of a bug if with completely the same parameters the behaviour would be tremendously different.
On the other hand … sure there can be a bug, I have not used the algorithm much, but all tests that I wrote show that the function value decreases.
By the way, if you just need opts.x
you can set return_options=false
and the solver will directly return x.
I've checked it, and the implementation seems incorrect. Moreover, the initial simplex can be constructed much better if we have an initial point and a basis at that point. I will make a PR soon with improvements.
My only issue is how to make an API for specifying a point and a basis given that by default NelderMead
already has a parameter for population. Do you have a preference?
The only disadvantage with such an PR now is, that NelderMead is the one algorithms that is already completely (with running tests) done in the new framework, so a PR on that would lead to me merging for two hours that into the new one. So while these ideas are all nice it is unfortunate that these ideas hit the same time as I am trying to cope with your first idea and polishing the code overall in the Rework PR.
Besides that, we can just type the popultation, i.e. AbstractArray
is the current population and Tuple{Point, Basis}
Is the other – since I think the size of the population is always n+1
?
OK, I can wait with that PR.
Yes, the size of population is always n+1
. How about, instead of a Tuple, making a new type NelderMeadSimplex
that can be initialized from a point and a basis? Something like NelderMeadSimplex(M, x0, DefaultOrthonormalBasis())
. This way we could add more customization there.
...and the current variant is a constructor NelderMeadSimplex(M, X)
? Sure sounds reasonable.
The current would be just NelderMeadSimplex(M)
(no X
).
Ah, I thought one could make the X an optional keyword, which gets filled with random points (like the current default) and if the user specifies X, then it is the identity? Hm sure but in chat case he could specify the population also directly. Then yours sounds more reasonable.
I will figure out the details of directly specifying a population later, maybe it will be nicer to also handle it by NelderMeadSimplex
.
See the following code, optiomization of the Rosenbrock function using Optim.jl and Manopt.jl:
when executed I get:
So Manopt calls objective much more times than Optim and still returns a much worse solution. Could that be a bug in Manopt?