[mlpack-git] [mlpack/mlpack] NeuralEvolution - implemented gene, genome (#686)
Marcus Edel
notifications at github.com
Sun Jun 26 19:07:07 EDT 2016
> + genome.AddLink(outputLink);
> + }
> +
> + // Crossover link weights.
> + // NOTICE: assume momGenome is the better genome.
> + // NOTICE: assume childGenome is empty.
> + void CrossoverLinkAndNeuron(Genome& momGenome, Genome& dadGenome, Genome& childGenome) {
> + // Add input and output neuron genes to child genome.
> + for (ssize_t i=0; i<(momGenome.NumInput() + momGenome.NumOutput()); ++i) {
> + childGenome.aNeuronGenes.push_back(momGenome.aNeuronGenes[i]);
> + }
> +
> + // Iterate to add link genes and neuron genes to child genome.
> + for (ssize_t i=0; i<momGenome.NumLink(); ++i) {
> + ssize_t innovId = momGenome.aLinkGenes[i].InnovationId();
> + ssize_t idx = dadGenome.GetLinkIndex(innovId);
I like the names of the genomes.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/686/files/a605eef0e349b0a08cc1a289c6857240c6ae5e23#r68511889
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160626/a9d357eb/attachment-0001.html>
More information about the mlpack-git
mailing list