[mlpack-git] [mlpack/mlpack] Neural evolution algorithms implementation (CNE, NEAT, HyperNEAT) (#686)
Marcus Edel
notifications at github.com
Sat Jul 16 18:10:48 EDT 2016
> + // Sort genomes by fitness. Smaller fitness is better and put first.
> + void SortGenomes(std::vector<Genome>& genomes) {
> + std::sort(genomes.begin(), genomes.end(), Species::CompareGenome);
> + }
> +
> + // Get genome index in a genomes vector.
> + ssize_t GetGenomeIndex(std::vector<Genome>& genomes, ssize_t id) {
> + for (ssize_t i=0; i<genomes.size(); ++i) {
> + if (genomes[i].Id() == id)
> + return i;
> + }
> + return -1;
> + }
> +
> + // Calculate species' average rank in population by fitness. Bigger is better.
> + void CalcSpeciesAverageRank(Population& population, std::vector<double>& speciesAverageRank) {
Don't we have to use the fitness of the genomes to calculate the rank?
---
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/fc982b9406838eb9697000481e816165702e8ba9#r71072586
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160716/9e578ec8/attachment.html>
More information about the mlpack-git
mailing list