wildart / Evolutionary.jl

Evolutionary & genetic algorithms for Julia
Other
328 stars 59 forks source link

tutorial script returns "Status: failure" #92

Closed manroygood closed 2 years ago

manroygood commented 2 years ago

I just downloaded Evolutionary.jl and tried out the Rosenbrock example in the tutorial from the REPL in Julia 1.7. It did not converge: Here's the input and output

julia> x0=[0.0 0.0];
julia> f(x) = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2;
julia> Evolutionary.optimize(f, x0, CMAES())

 * Status: failure (reached maximum number of iterations)

 * Candidate solution
    Minimizer:  [0.7194176052090903, 0.5156335000355626]
    Minimum:    0.0790982721845758
    Iterations: 1500

 * Found with
    Algorithm: (15,30)-CMA-ES

 * Work counters
    Seconds run:   0.0824 (vs limit Inf)
    Iterations:    1500
    f(x) calls:    46500

Any ideas?

wildart commented 2 years ago

Looks like some default parameters are off, especially recombination weights.

manroygood commented 2 years ago

Thanks. I just downloaded the package and was trying it out before diving into the documentation. Would you be able to suggest options that would make the example work so I can play with this while you work on fixing the bug?

wildart commented 2 years ago

You may try to decrease step size for covariance update sigma0 parameter to some value in range [0.25..0.5]. Weights are trickier, you have to wait for update on that.