<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'>> + double p = mlpack::math::Random();
> + if (p<mutateProb && linkIndexs.size()>0) {
> + ssize_t idx = linkIndexs[mlpack::math::RandInt(0, linkIndexs.size())];
> + genome.aLinkGenes[idx].Enabled(!enabled); // Reverse enabled status to opposite.
> + }
> + }
> +
> + // Mutate: change single weight. Combine both biased and unbiased mutation.
> + void MutateWeight(Genome& genome, double mutateProb, double perturbProb, double mutateSize) {
> + double p = mlpack::math::Random(); // rand 0~1
> + if (p > mutateProb) return;
> +
> + for (ssize_t i=0; i<genome.aLinkGenes.size(); ++i) {
> + double p2 = mlpack::math::Random();
> + if (p2 < perturbProb) { // Biased weight mutation.
> + 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;">—<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>