[mlpack-git] [mlpack/mlpack] NeuralEvolution - implemented gene, genome (#686)

Excalibur notifications at github.com
Mon Jun 27 00:20: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);

Thanks!

---
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#r68521003
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160626/3bb4a1a4/attachment.html>


More information about the mlpack-git mailing list