TLmaK0 / rustneat

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

Accumulation of my work on this library (attempt 2) #43

Closed Ploppz closed 4 years ago

Ploppz commented 4 years ago

To summarize the most important contribution of this PR: Taking inspiration from other implementations (python and C#), I have managed to improve the algorithm to a point where it almost always finds a solution to the XOR problem. Only rarely does exceed the number of given generations.

(that said, an undeterministic test (referring to the "can solve xor" test) is not desirable so we should really start to work with seeds eventually so that we can for example find one seed where the test works and use this to make the test deterministic)

I have rebased commits on top of master and at the same time decreased the number of commits in an attempt to make it all easier to understand. Most algorithmic changes are put in one commit, and changes are summarized in the commit message.

Some renaming had to be done in the first of these commits (introducing generics) for it to make sense, as explained in #41. I'm sorry I could not delay these renaming changes to the end as requested in #39, it was simply not practical. I did my best to make a small number of commits each with a single feature or theme, so I hope it is understandable now.

The work of @playXE and @Aedius is rebased into one commit each (preserving their authorship).

One outstanding question:

TLmaK0 commented 4 years ago

I think that if someone uses this library should not use 'src/bin/{hyper_opt.rs, xor_performance.rs}', because they are an specific implementation of a neural network to solve a problem. And as you say in a comment it adds new dependencies. I think the library should depends as less libraries as we can.

TLmaK0 commented 4 years ago

If I understand correctly we should close #39 because this PR will replace it, right? Do you think is possible to break all of this commits in subsequent PR? So we can review one by one an integrate every one as soon as possible to master branch. We can split it in this PRs: Generic rewrite … 9cf2576 Neuron genes, rayon and simplifications … 92ef285 Algorithm improvements … 595ff52 Introduce Params (parameters struct) … 1662116 Algorithmic improvements … 09e4337 Allow evaluating fitness not in parallel and further fixing tests and fmt 343041c

And thanks for your help!

Ploppz commented 4 years ago

Yes I'll get to it