[mlpack-git] [mlpack/mlpack] Neural evolution algorithms implementation (CNE, NEAT, HyperNEAT) (#686)

Excalibur notifications at github.com
Sat Jul 16 00:48:11 EDT 2016


> +  bool BreedChild(Species& species, Genome& childGenome, double crossoverProb) {
> +    ////printf("breed 1\n");
> +    double p = mlpack::math::Random();
> +    ssize_t speciesSize = species.aGenomes.size();
> +    ////printf("species size is %d \n", speciesSize);
> +    ////printf("breed 2\n");
> +    if (speciesSize == 0)
> +      return false;
> +
> +    if (p < crossoverProb) {
> +      ssize_t idx1 = mlpack::math::RandInt(0, speciesSize);
> +      ssize_t idx2 = mlpack::math::RandInt(0, speciesSize);
> +      ////printf("idx1 is %d\n", idx1);
> +      ////printf("idx2 is %d\n", idx2);
> +      ////printf("breed 3\n");
> +      Crossover(species.aGenomes[idx1], species.aGenomes[idx2], childGenome);

Revised.

---
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#r71060987
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160715/4fe9af79/attachment-0001.html>


More information about the mlpack-git mailing list