[mlpack-git] [mlpack/mlpack] CNE algorithm (#753)

Marcus Edel notifications at github.com
Mon Aug 8 17:16:47 EDT 2016


> +  // Set best fitness.
> +  void BestFitness(double bestFitness) { aBestFitness = bestFitness; }
> +
> +  // Get best fitness.
> +  double BestFitness() const { return aBestFitness; }
> +
> +  // Get species size.
> +  int SpeciesSize() const { return aGenomes.size(); }
> +
> +  // Set best fitness to be the minimum of all genomes' fitness.
> +  void SetBestFitnessAndGenome() {
> +    if (aGenomes.size() == 0) 
> +      return;
> +
> +    aBestFitness = aGenomes[0].Fitness();
> +    for (int i=0; i<aGenomes.size(); ++i) {

In that case aGenomes.size() is 1 and we don't enter the for loop, right? Also, what do you think about the unset aBestGenome problem if genome with index 0 has the best fitness?


---
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/753/files/10b99ab5c6e8d2836d231fa60a898cc03f7d9192#r73956503
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160808/e0d5770d/attachment.html>


More information about the mlpack-git mailing list