<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r70420703">src/mlpack/methods/ne/neat.hpp</a>:</p>
<pre style='color:#555'>&gt; +    double p = mlpack::math::Random();
&gt; +    if (p&lt;mutateProb &amp;&amp; linkIndexs.size()&gt;0) {
&gt; +      ssize_t idx = linkIndexs[mlpack::math::RandInt(0, linkIndexs.size())];
&gt; +      genome.aLinkGenes[idx].Enabled(!enabled);  // Reverse enabled status to opposite.
&gt; +    }
&gt; +  }
&gt; +
&gt; +  // Mutate: change single weight. Combine both biased and unbiased mutation.
&gt; +  void MutateWeight(Genome&amp; genome, double mutateProb, double perturbProb, double mutateSize) {
&gt; +    double p = mlpack::math::Random();  // rand 0~1
&gt; +    if (p &gt; mutateProb) return;
&gt; +    
&gt; +    for (ssize_t i=0; i&lt;genome.aLinkGenes.size(); ++i) {  
&gt; +      double p2 = mlpack::math::Random();
&gt; +      if (p2 &lt; perturbProb) {  // Biased weight mutation.
&gt; +        double deltaW = mlpack::math::RandNormal(0, mutateSize);
</pre>
<p>Right, I was thinking about randu.</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#r70420703">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFBjGDHF5X_bpf1r_oYyOIO_19reUks5qU3pWgaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFK60L2uQRZiwjjbP-_oA6_IsovUQks5qU3pWgaJpZM4IwJa6.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#r70420703"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>