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

Excalibur notifications at github.com
Sat Jul 16 20:43:06 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) {

Sorry, but I am not clear what this means.
The average rank is the average of each genome's rank in this species. And
the rank of each genome is using the fitness of genome.

2016-07-16 16:10 GMT-06:00 Marcus Edel <notifications at github.com>:

> In src/mlpack/methods/ne/neat.hpp
> <https://github.com/mlpack/mlpack/pull/686#discussion_r71072586>:
>
> > +  // 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 commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/mlpack/mlpack/pull/686/files/fc982b9406838eb9697000481e816165702e8ba9#r71072586>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AD9tIVCQH5xIrGfVvpnSYirkncnnHtBGks5qWVbmgaJpZM4IwJa6>
> .
>


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


More information about the mlpack-git mailing list