<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r69383675">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>Using a RandNormal doesn't look right, it should be possible to alter the weight in both directions.</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#r69383675">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFH0js1PL6kx5anpe05JXQIGvQVlbks5qRvI4gaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFLy42oGlOjcuMaIebxeUlg0t66HGks5qRvI4gaJpZM4IwJa6.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#r69383675"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>