<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r69383713">src/mlpack/methods/ne/neat.hpp</a>:</p>
<pre style='color:#555'>&gt; +
&gt; +  // Measure two genomes&#39; weight difference.
&gt; +  // TODO: what if one or two weights are disabled? 0 or still the weight?
&gt; +  double WeightDiff(Genome&amp; genome1, Genome&amp; genome2) {
&gt; +    double deltaW = 0;
&gt; +    ssize_t coincident = 0;
&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 - 
</pre>
<p>Neat idea, using the enabled bit.</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/554a279b0089e4385dfb40077e578d6ae2a42ece#r69383713">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFIF1iyY_NqDq3dEpd7mzVYygI2hlks5qRvQZgaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFBuPfDLvjPJ0-UC-YcRb54-n3aA9ks5qRvQZgaJpZM4IwJa6.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/554a279b0089e4385dfb40077e578d6ae2a42ece#r69383713"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>