[mlpack-git] [mlpack/mlpack] CNE algorithm (#753)
Excalibur
notifications at github.com
Sun Aug 7 17:36:20 EDT 2016
> + // TODO: here we use uniform distribution. Can we use exponential distribution?
> + static void MutateWeightsBiased(Genome& genome, double mutateProb, double mutateSize) {
> + for (int i=0; i<genome.aLinkGenes.size(); ++i) {
> + double p = mlpack::math::Random(); // rand 0~1
> + if (p < mutateProb) {
> + double deltaW = mlpack::math::RandNormal(0, mutateSize);
> + double oldW = genome.aLinkGenes[i].Weight();
> + genome.aLinkGenes[i].Weight(oldW + deltaW);
> + }
> + }
> + }
> +
> + // Hard mutation: replace with a random value chosen from
> + // initialization prob distribution with probability p.
> + // TODO: here we use uniform distribution. Can we use exponential distribution?
> + static void MutateWeightsUnbiased(Genome& genome, double mutateProb, double mutateSize) {
Yeah, we can do this.
---
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#r73809611
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160807/2fee6d51/attachment.html>
More information about the mlpack-git
mailing list