This PR is basically the same as https://github.com/TLmaK0/rustneat/pull/36, although with some more rebasing, and the discussion there is thus still relevant.
Note that it includes part of your feature/function_approximation branch.
I disabled the "should solve XOR" test. Because this version still struggles with that, but in https://github.com/TLmaK0/rustneat/pull/39 it is more or less solved and in the last of my PRs we can thus enable it again.
To summarize a bit, at least the important bits of what I remember:
Genome is a trait that implements mutation, mating, distance measure etc. (opens up for more experimentation and extensibility)
The default Genome implementor is NeuralNetwork which implements said functionality pretty much just as before. So NeuralNetwork is the new Genome.
Some slight changes in how bias works had to be done to be able to mirror the way they do it in some paper that introduced or explained CTRNN iirc.
The high changed-lines count accounts for a lot of moving of functionality. For example old Genome -> new NeuralNetwork, and ctrnn.rs was moved into nn/ctrnn.rs. I realize you said in #39:
These pull request shouldn't change any path nor class name.
But I hope that you accept a small change like that. (and as for the Genome/Organism/NeuralNetwork renaming, that just had to be done as part of making the generic version make sense). Because all my subsequent work relies on this 'generic rewrite', it would create too much work if I were to try to delay the generic rewrite until the very end...
I suppose anyway that you shouldn't merge these intermediate PRs, but only the last one? This way you can review the total of all changes (more easily than with one big PR). I think the next PRs will be easier to understand.
As part of https://github.com/TLmaK0/rustneat/pull/39.
This PR is basically the same as https://github.com/TLmaK0/rustneat/pull/36, although with some more rebasing, and the discussion there is thus still relevant. Note that it includes part of your
feature/function_approximation
branch.I disabled the "should solve XOR" test. Because this version still struggles with that, but in https://github.com/TLmaK0/rustneat/pull/39 it is more or less solved and in the last of my PRs we can thus enable it again.
To summarize a bit, at least the important bits of what I remember:
NeuralNetwork
which implements said functionality pretty much just as before. SoNeuralNetwork
is the newGenome
.The high changed-lines count accounts for a lot of moving of functionality. For example old Genome -> new NeuralNetwork, and ctrnn.rs was moved into nn/ctrnn.rs. I realize you said in #39:
But I hope that you accept a small change like that. (and as for the Genome/Organism/NeuralNetwork renaming, that just had to be done as part of making the generic version make sense). Because all my subsequent work relies on this 'generic rewrite', it would create too much work if I were to try to delay the generic rewrite until the very end...
I suppose anyway that you shouldn't merge these intermediate PRs, but only the last one? This way you can review the total of all changes (more easily than with one big PR). I think the next PRs will be easier to understand.