[mlpack-git] [mlpack/mlpack] NeuralEvolution - implemented gene, genome (#686)

Marcus Edel notifications at github.com
Sat Jul 2 18:21:31 EDT 2016


> +    return aLinkGenes.size();
> +  }
> +
> +  // Whether specified neuron id exist in this genome.
> +  bool HasNeuronId(ssize_t id) const {
> +    for (ssize_t i=0; i<NumNeuron(); ++i) {
> +      if (aNeuronGenes[i].Id() == id) {
> +        return true;
> +      }
> +    }
> +    
> +    return false;
> +  }
> +
> +  // Get neuron by id.
> +  NeuronGene GetNeuronById(ssize_t id) {

We could avoid probably expensive copy (NeuronGene), by using a reference:

``void GetNeuronById(ssize_t id, NeuronGene& gene)``


---
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#r69383375
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160702/56a05e4d/attachment.html>


More information about the mlpack-git mailing list