<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r68521047">src/mlpack/methods/ne/neat.hpp</a>:</p>
<pre style='color:#555'>> +
> + 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());
</pre>
<p>According to the NEAT paper, only calculate the difference of matched links. <br>
Also, I just found that crossover and distance calculation also consider disabled links. Thus, I revised corresponding functions.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/686/files/a605eef0e349b0a08cc1a289c6857240c6ae5e23#r68521047">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFPMdEzwVzFRTulQ042vgjBjXdXALks5qP0_EgaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFBdlrSBZawJUdxRsKBBiv5tFqdtuks5qP0_EgaJpZM4IwJa6.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/686/files/a605eef0e349b0a08cc1a289c6857240c6ae5e23#r68521047"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>