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

Marcus Edel notifications at github.com
Sun Aug 7 09:57:51 EDT 2016


> +        int fromNeuronIdx = GetNeuronIndex(aLinkGenes[i].FromNeuronId());
> +        double input = aNeuronGenes[toNeuronIdx].Input() + 
> +                       aNeuronGenes[fromNeuronIdx].Activation() * aLinkGenes[i].Weight();
> +        aNeuronGenes[toNeuronIdx].Input(input);
> +        
> +        if (i == NumLink() - 1) {
> +          aNeuronGenes[toNeuronIdx].CalcActivation();
> +        } else if (GetNeuronIndex(aLinkGenes[i + 1].ToNeuronId()) != toNeuronIdx) {
> +          aNeuronGenes[toNeuronIdx].CalcActivation();
> +        }
> +      }
> +    }
> +  }
> +
> +  // Get output vector.
> +  void Output(std::vector<double>& output) {

I suggest to use arma::vec for the output, in this case, we can use a bunch of mlpack methods that can directly work with the output, what do you think? The same applies to the input. E.g. we could directly use PCA to preprocess the input. Also, we could allocate the memory once, and overwrite the results in every iteration instead of clearing the vector.

---
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#r73802392
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160807/33345be1/attachment.html>


More information about the mlpack-git mailing list