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

Marcus Edel notifications at github.com
Thu Jul 14 20:15:49 EDT 2016


> +    for (ssize_t i=0; i<population.aSpecies.size(); ++i) {
> +      double averageRank = 0;
> +      ssize_t speciesSize = population.aSpecies[i].aGenomes.size();
> +      for (ssize_t j=0; j<speciesSize; ++j) {
> +        averageRank += genomes.size() - GetGenomeIndex(genomes, population.aSpecies[i].aGenomes[j].Id());
> +      }
> +      averageRank = averageRank / speciesSize;
> +      speciesAverageRank.push_back(averageRank);
> +    }
> +  }
> +
> +  // Remove weak species.
> +  void RemoveWeakSpecies(Population& population) {
> +    std::vector<double> speciesAverageRank;
> +    CalcSpeciesAverageRank(population, speciesAverageRank);
> +    double totalAverageRank = std::accumulate(speciesAverageRank.begin(), speciesAverageRank.end(), 0);

Let us use a bool here or do the comparison in the if condition.

---
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/48e15c45ab1a9c65dbd8fe3fe6f07e368c965883#r70905235
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160714/4e043d66/attachment.html>


More information about the mlpack-git mailing list