[mlpack-git] [mlpack/mlpack] NeuralEvolution - implemented gene, genome (#686)
Marcus Edel
notifications at github.com
Sat Jul 2 18:39:01 EDT 2016
> + std::vector<double> toNeuronDepths;
> + for (ssize_t i=0; i<aLinkGenes.size(); ++i) {
> + NeuronGene toNeuron = GetNeuronById(aLinkGenes[i].ToNeuronId());
> + toNeuronDepths.push_back(toNeuron.Depth());
> + }
> +
> + std::vector<DepthAndLink> depthAndLinks;
> + ssize_t linkGenesSize = aLinkGenes.size();
> + for (ssize_t i=0; i<linkGenesSize; ++i) {
> + depthAndLinks.push_back(DepthAndLink(toNeuronDepths[i], aLinkGenes[i]));
> + }
> +
> + std::sort(depthAndLinks.begin(), depthAndLinks.end());
> +
> + for (ssize_t i=0; i<linkGenesSize; ++i) {
> + aLinkGenes[i] = depthAndLinks[i].link;
I think, we could speed this up, if we would just store the index of all linkGenes, an use another list, that contains all linkGenes as a reference.
---
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/554a279b0089e4385dfb40077e578d6ae2a42ece#r69383465
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160702/6c68c985/attachment.html>
More information about the mlpack-git
mailing list