Closed Ploppz closed 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.
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!
Yes I'll get to it
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:
src/bin/{hyper_opt.rs, xor_performance.rs}
outside of this library. I don't mind at all but I haven't yet done that because I wonder where should they be?xor_performance.rs
is nice to have as it measures either the mean solve time, or the mean score after a fixed amount of generation, for the xor problem (or alternatively another problem) - could be really useful for further improvement of the algorithm.hyper_opt.rs
is an attempt at hyperparameter optimization. Could be useful but not necessary and I am not sure myself how far one can really improve performance by tuning parameters. I will readily delete these files if desired.