<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r69383638">src/mlpack/methods/ne/neat.hpp</a>:</p>
<pre style='color:#555'>> + true);
> + genome.AddLink(inputLink);
> + genome.AddLink(outputLink);
> + }
> +
> + // Mutate: enable disabled, or disable enabled link.
> + void MutateEnableDisable(Genome& genome, bool enabled, double mutateProb) {
> + std::vector<ssize_t> linkIndexs;
> + for (ssize_t i=0; i<genome.NumLink(); ++i) {
> + if (genome.aLinkGenes[i].Enabled() == enabled) {
> + linkIndexs.push_back(i);
> + }
> + }
> +
> + double p = mlpack::math::Random();
> + if (p<mutateProb && linkIndexs.size()>0) {
</pre>
<p>I think it worth to check the mutate probability before we generate the <code>linkIndexs</code>list.</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#r69383638">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFLfIRik01zb3mAf70mrX33AU03Mlks5qRvBogaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOG_KnFAXO-xnLgNe4Al6N0PpjIiks5qRvBogaJpZM4IwJa6.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#r69383638"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>