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

Marcus Edel notifications at github.com
Sun Jun 26 19:14:45 EDT 2016


> +
> +    ssize_t largerGenomeSize = std::max(genome1.NumLink(), genome2.NumLink());
> +    double deltaD = numDisjoint / largerGenomeSize;
> +    return deltaD; 
> +  }
> +
> +  // Measure two genomes' weight difference.
> +  double WeightDiff(Genome& genome1, Genome& genome2) {
> +    double deltaW = 0;
> +    ssize_t coincident = 0;
> +
> +    for (ssize_t i=0; i<genome1.NumLink(); ++i) {
> +      ssize_t innovId = genome1.aLinkGenes[i].InnovationId();
> +      ssize_t idx = genome2.GetLinkIndex(innovId);
> +      if (idx != -1 && genome1.aLinkGenes[i].Enabled()) {
> +        deltaW += std::abs(genome1.aLinkGenes[i].Weight() - genome2.aLinkGenes[idx].Weight());

If genome2 is disabled, isn't the weight difference, just the weight of genome1?

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


More information about the mlpack-git mailing list