<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r70640409">src/mlpack/methods/ne/neat.hpp</a>:</p>
<pre style='color:#555'>&gt; +
&gt; +    for (ssize_t i=0; i&lt;genome1.NumLink(); ++i) {
&gt; +      int linkEnabledInGenome1 = (int) genome1.aLinkGenes[i].Enabled();
&gt; +      ssize_t innovId = genome1.aLinkGenes[i].InnovationId();
&gt; +      ssize_t idx = genome2.GetLinkIndex(innovId);
&gt; +      bool linkContainedInGenome2 = (idx != -1);
&gt; +
&gt; +      if (linkContainedInGenome2) {
&gt; +        int linkEnabledInGenome2 = (int) genome2.aLinkGenes[idx].Enabled();
&gt; +        deltaW += std::abs(genome1.aLinkGenes[i].Weight() * linkEnabledInGenome1 - 
&gt; +                           genome2.aLinkGenes[idx].Weight() * linkEnabledInGenome2);
&gt; +        ++coincident;
&gt; +      }
&gt; +    }
&gt; +
&gt; +    deltaW = deltaW / coincident;
</pre>
<p>We should check if matching or coincident is &gt; 0.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<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/ff45785b8669f82beb38ef5392f48bcdf5c83f6a#r70640409">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFCRM0igZpjoGMki3ePYv76rD9w1Uks5qVPtzgaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFGUInmBaiRHp_VRSmTHw0iEXttLcks5qVPtzgaJpZM4IwJa6.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/ff45785b8669f82beb38ef5392f48bcdf5c83f6a#r70640409"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>