Giter Club home page Giter Club logo

Comments (6)

wildart avatar wildart commented on June 7, 2024 1

Indeed, the current implementation mutates elite population, and this is unconventional to the common practice of elitism implementation. It's worth considering to copy elite individuals intact.

from evolutionary.jl.

daviehh avatar daviehh commented on June 7, 2024

Also ran into this issue with the DE() algorithm at #112 , guess with the GA the results from previous iteration (which contain the actual minimizer) can be overwritten by later iterations, possibly somewhere

minfit, fitidx = findmin(state.fitpop)
state.fittest = offspring[fitidx]
state.fitness = state.fitpop[fitidx]
# replace population
parents .= offspring

for the GA.

from evolutionary.jl.

daviehh avatar daviehh commented on June 7, 2024

Would the test result at commit timholy/ScheduleMeetings.jl@1dae62f

Iter     Function value
     0               14
 * time: 0.00019502639770507812
     1               14
 * time: 0.018580913543701172
     2               14
 * time: 0.018917083740234375
     3               14
 * time: 0.01920604705810547
     4               14
 * time: 0.01949787139892578
     5               14
 * time: 0.019734859466552734
     6               14
 * time: 0.019989013671875
     7               14
 * time: 0.02025890350341797
     8               14
 * time: 0.020509958267211914
     9               14
 * time: 0.02074599266052246
    10               14
 * time: 0.020987987518310547
    11               14
 * time: 0.0212399959564209
    12               14
 * time: 0.021517038345336914
Evolutionary.minimum(result) = 14
f(perm0) = 14
Evolutionary.minimizer(result) = [1, 2, 3, 1, 2, 3]
perm0 = [1, 2, 3, 1, 2, 3]

in agreement with what you expect? Got the result above when changing the minimize logic here

state.fittest = offspring[fitidx]
state.fitness = state.fitpop[fitidx]

with

if (minfit < state.fitness)
     state.fittest = offspring[fitidx]
     state.fitness = state.fitpop[fitidx]
end

to avoid the result being overwritten by later iterations when it's not actually the optimized minimizer

from evolutionary.jl.

timholy avatar timholy commented on June 7, 2024

In the main branch I've modified the test to be a little more challenging (that solution is optimal, but it's also the initial guess). You could try your code patch with the current test?

from evolutionary.jl.

wildart avatar wildart commented on June 7, 2024

You may want to play with a mutation rate (decrease) or population size (increase) for more stable performance. Plus, instead of the default tournament selector, you could use more aggressive susinv to drive a population of low fitness permutations up.

I also found that the best permutation is [2, 2, 3, 1, 1, 3] with the fitness value 21, and it isn't possible to get such permutation with your mutation function swap2blocks as it only swaps numbers within a block. So, the starting permutation [1, 2, 3, 1, 2, 3] appears to be an optimal choice.

from evolutionary.jl.

timholy avatar timholy commented on June 7, 2024

In #108 I raised the question of whether it would make sense to provide an option to preserve the best-so-far individual ("elite" individuals are still subject to mutation, and hence they can be degraded as well as improved). Perhaps a copy could be made before mutation, so that you'd be sure to avoid any worsening? I'd defer to @wildart who knows much more than I about such matters.

from evolutionary.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.