Giter VIP home page Giter VIP logo

Comments (6)

MaxHalford avatar MaxHalford commented on May 17, 2024

Hey,

The minimum fitness you're seeing is not the best obtained fitness. It's the minimum fitness inside the population. The HallOfFame property will give you the best obtained solutions, along with their

However, it is a bit weird that the populations fitness is going up. If you can share the code I can look into why this is happening. To be totally honest I haven't battle-tested gago.ModMutationOnly so it might have a bug.

from eaopt.

gwd avatar gwd commented on May 17, 2024

Thanks for the quick response!

Yes, I understand that HallOfFame is where to look for the "best seen so far"; but what I'm finding is that the "best seen so far" in this case is always one of the initial, randomly-chosen populations: further evolution with ModMutationOnly never results in any better results. And when I looked into it, the reason was pretty obvious -- the actual population keeps getting worse instead of better! :-)

I don't see this effect with ModGenerational or ModDownToSize, but for some reason the results are still not very good -- I wrote an alternate search function that literally just generates random solutions, and it usually outperforms the genetic search, which is why I started exploring other options, and noticed this effect. (I think one of the other ones I tried had a similar effect -- maybe ModSteadyState.)

Regarding code, it's hard to share less than the whole thing in this case. I made a branch that reproduces this problem. The main repo is http://github.com/gwd/session-scheduler , and the branch name is out/ModMutationOnly-repro/v1. Once you've built it, run the following commands:

mkdir data
./session-scheduler -count=-500 testpopulate
./session-scheduler testinterest

That will generate a bunch of random users, a bunch of random discussion sessions, and set the "interest" of users in attending various sessions between 0 and 100. At that point, we just need to generate a schedule that maximizes happiness, as calculated by the sum of 'interest' when a user is able to attend the sessions they want to.

To run the genetic algorithm scheduler, just run:

./session-scheduler schedule

This will run the search for 30s, and compare the results to to a "heuristic" scheduler (greedy first-fit), and choose the best one. If you want more data about what's going on, add the -sched-debug flag (before the schedule command). (You probably want to pipe to a file in that case.) You can try various things I've tried: -searchalgo=random will use the completely random method I mentioned above; -crossover=false will cause the crossover function to return without doing anything, and so on. All the actual scheduling happens in schedule.go.

I realize this is a lot, so if you don't have time to dig into this, don't worry; my 'random' scheduler will do well enough for the time being. I mainly just wanted to let you know there might be a bug (and/or see if I'm doing something obviously wrong, like using arbitrarily large negative scores).

from eaopt.

MaxHalford avatar MaxHalford commented on May 17, 2024

Okay cheers for linking the code. I'm a bit busy at the moment but I should be able to free some time over the weekend. Hang tight!

from eaopt.

MaxHalford avatar MaxHalford commented on May 17, 2024

Hey,

I went through the code and noticed that the mutants would replace the initial individual if the fitness was higher, which is not the intended behaviour. I've corrected this and pushed the fix to GitHub.

Can you try it again and tell me if it works?

from eaopt.

gwd avatar gwd commented on May 17, 2024

That seemed to do the trick. Thanks!

from eaopt.

MaxHalford avatar MaxHalford commented on May 17, 2024

Awesome! Closing this. Tell me if you have any other questions!

from eaopt.

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.