[mlpack-git] [mlpack/mlpack] CNE algorithm (#753)
Marcus Edel
notifications at github.com
Sun Aug 7 10:34:53 EDT 2016
> + void Evolve() {
> + // Generate initial species at random.
> + int generation = 0;
> + InitSpecies();
> +
> + // Repeat
> + while (generation < aMaxGeneration) {
> + // Evaluate all genomes in the species.
> + for (int i=0; i<aSpecies.SpeciesSize(); ++i) {
> + double fitness = aTask.EvalFitness(aSpecies.aGenomes[i]);
> + aSpecies.aGenomes[i].Fitness(fitness);
> + }
> + aSpecies.SetBestFitnessAndGenome();
> +
> + // Output some information.
> + printf("Generation: %zu\tBest fitness: %f\n", generation, aSpecies.BestFitness());
I think it would be better to use Log::Info here, in that case a user can disable any output e.g:
```
Log::Info << "Generation: " << generation << " best fitness: " << species.BestFitness() << std::endl
```
or something like that, the important thing is a user can disable the output.
---
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#r73802940
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160807/6fb5f15b/attachment.html>
More information about the mlpack-git
mailing list