[mlpack-git] [mlpack/mlpack] NeuralEvolution - implemented gene, genome (#686)
Excalibur
notifications at github.com
Sat Jun 11 15:09:35 EDT 2016
> + // Destructor.
> + ~Population() {}
> +
> + // Set/get best fitness.
> + double& BestFitness() { return aBestFitness; }
> +
> + // Set best fitness to be the minimum of all genomes' fitness.
> + void SetBestFitness() {
> + if (aGenomes.size() == 0)
> + return;
> +
> + aBestFitness = aGenomes[0].Fitness();
> + for (size_t i=0; i<aGenomes.size(); ++i) {
> + if (aGenomes[i].Fitness() < bestFitness) {
> + aBestFitness = aGenomes[i].Fitness();
> + }
Yeah, I have this idea in my mind. Actually I think we can add a SortByFitness() function to sort the genomes in population, so that we can get k best genomes easily.
---
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/65f093daf32f6cb353cd6b9304bab88a5e096fdc#r66710297
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160611/e872b745/attachment.html>
More information about the mlpack-git
mailing list