<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'>> +
> + // Measure two genomes' weight difference.
> + // TODO: what if one or two weights are disabled? 0 or still the weight?
> + double WeightDiff(Genome& genome1, Genome& genome2) {
> + double deltaW = 0;
> + ssize_t coincident = 0;
> +
> + for (ssize_t i=0; i<genome1.NumLink(); ++i) {
> + int linkEnabledInGenome1 = (int) genome1.aLinkGenes[i].Enabled();
> + ssize_t innovId = genome1.aLinkGenes[i].InnovationId();
> + ssize_t idx = genome2.GetLinkIndex(innovId);
> + bool linkContainedInGenome2 = (idx != -1);
> +
> + if (linkContainedInGenome2) {
> + int linkEnabledInGenome2 = (int) genome2.aLinkGenes[idx].Enabled();
> + 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;">—<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>