[mlpack-git] [mlpack/mlpack] NeuralEvolution - implemented gene, genome (#686)

Marcus Edel notifications at github.com
Sat Jul 2 19:12:40 EDT 2016


> +                        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) {

I think it worth to check the mutate probability before we generate the `linkIndexs`list.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/686/files/554a279b0089e4385dfb40077e578d6ae2a42ece#r69383638
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160702/a0c3d054/attachment-0001.html>


More information about the mlpack-git mailing list