TLmaK0 / rustneat

Rust Neat - NeuroEvolution of Augmenting Topologies
MIT License
68 stars 16 forks source link

Accumulation of my work on this library #39

Closed Ploppz closed 4 years ago

Ploppz commented 5 years ago

I have been working on it for my master thesis the previous semester. At this point it is more or less finalized. The XOR test passes the vast majority of times, but not strictly always, so I do believe it is unfitting as a test (non-deterministic), unless we give it a large number of generations.

I will not go into detail about the changes. In general I have taken inspiration from neat-python and how they do things. Some simplifications have been done and every possible aspect has been parameterized in NeatParams. You can also do hyperparameter optimization (using a Bayesian strategy through the blackbox crate I created). Feel free to ask any questions about the code.

Ploppz commented 5 years ago

I don't understand from the logs why the build fails.

TLmaK0 commented 5 years ago

Thanks @Ploppz for your help. I will try to understand all the stuff. I think the problem with the build is the "fmt" run, could be an issue with new version. https://travis-ci.org/TLmaK0/rustneat/jobs/552707545#L637

Ploppz commented 4 years ago

I think I know why that test failed. In a recent commit: ~let n_elite = if self.organisms.len() > 5 { 1 } else { 1 };~ let n_elite = if self.organisms.len() > 5 { 2 } else { 0 };

If n_elite is 0 it is possible that the globally best organism is killed. The reason I wrote it like that (edit: I mean the useless if structure, which clippy probably complained about) was to have the possibility to change these later. Will fix and see if this fixes the tests. (and the reason I added this test was that I personally found it important that evolution does not regress in terms of "best organism in current population". This is debatable of course.)

Aedius commented 4 years ago

@Ploppz it's one of my commits, i follow the comment l 122: // to random selection. NOTE: For now, we always have n_elite = 2 or 0. you should change it accordingly

Ploppz commented 4 years ago

I started rebasing but I find it rather confusing and difficult due to the timespan and amount of commits. Would it be ok to just merge upstream master into this branch to fix conflicts (note that the conflict is only one commit with two lines)?

Ploppz commented 4 years ago

Sorry for the delay. Your plan makes sense, and I will try eventually to make those pull requests. I just currently don't have a lot of time.

TLmaK0 commented 4 years ago

Tx @Ploppz. I know this requires a big effort from you, but I think will help us to fully understand the changes.