Comments (6)
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.
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.
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.
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.
That seemed to do the trick. Thanks!
from eaopt.
Awesome! Closing this. Tell me if you have any other questions!
from eaopt.
Related Issues (20)
- More generation statistics? HOT 6
- Crash... HOT 14
- data race in util_random.go:70 HOT 3
- ga.Best is genome with the lowest fitness? HOT 2
- Evaluate against other genome HOT 7
- Parallelizing Individual Evaluate() calls? HOT 7
- Gene Uniqueness - PMX/OX HOT 9
- tag a new release HOT 8
- Non-canonical roulette wheel is being built relative to a 'random' fitness? HOT 1
- NOffsprings has to higher than 0 HOT 3
- Pass aditional data in Evaluate function HOT 10
- CrossCX and CrossERX relies on hashable types HOT 1
- Crossover method not modifying genome HOT 2
- Is CrossUniformFloat64 correct? HOT 3
- Opt into Go module system HOT 4
- Most models do not honor ParallelEval
- Multiple Objectives
- Document the Crossover functions a bit better with examples HOT 3
- Very big repository HOT 22
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eaopt.