Skip to content

At least DE and GA are completely broken #130

@mattsignorelli

Description

@mattsignorelli

Perhaps this package no longer maintained?

Copy-pasting from the documentation:

using Evolutionary
f(x) = (1.0 - x[1])^2 + 100.0 * (x[2] - x[1]^2)^2 # Rosenbrock

x0 = [0.0, 0.0];
Evolutionary.optimize(f, x0, GA())

Output:

* Status: success

 * Candidate solution
    Minimizer:  [0.0, 0.0]
    Minimum:    1.0
    Iterations: 12

 * Found with
    Algorithm: GA[P=50,x=0.8,μ=0.1,ɛ=0]

 * Convergence measures
    |f(x) - f(x')| = 0.0 ≤ 1.0e-12

 * Work counters
    Seconds run:   0.0 (vs limit Inf)
    Iterations:    12
    f(x) calls:    650

Clearly this is not correct. Now same for DE:

x0 = [0.0, 0.0];
Evolutionary.optimize(f, x0, DE())
 * Status: success

 * Candidate solution
    Minimizer:  [0.0, 0.0]
    Minimum:    1.0
    Iterations: 12

 * Found with
    Algorithm: DE/random/1/binxvr

 * Convergence measures
    |f(x) - f(x')| = 0.0 ≤ 1.0e-10

 * Work counters
    Seconds run:   0.0002 (vs limit Inf)
    Iterations:    12
    f(x) calls:    600

Also completely wrong.

Now inject code and observe that it isn't even trying any points other than x0:

g(x) = (println(x);  return f(x))
Evolutionary.optimize(g, x0, DE())

Output:

[0.0, 0.0]
[0.0, 0.0]
[0.0, 0.0]
[0.0, 0.0]
[0.0, 0.0]
[0.0, 0.0]
[0.0, 0.0]
[0.0, 0.0]
# ... repeated many times

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions