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

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

According to the NEAT paper, only calculate the difference of matched links. 
Also, I just found that crossover and distance calculation also consider disabled links. Thus, I revised corresponding functions.

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


More information about the mlpack-git mailing list