[mlpack-git] [mlpack/mlpack] NeuralEvolution - implemented gene, genome (#686)
Excalibur
notifications at github.com
Mon Jun 27 10:44:09 EDT 2016
> +
> + ssize_t largerGenomeSize = std::max(genome1.NumLink(), genome2.NumLink());
> + double deltaD = numDisjoint / largerGenomeSize;
> + return deltaD;
> + }
> +
> + // Measure two genomes' weight difference.
> + double WeightDiff(Genome& genome1, Genome& genome2) {
> + double deltaW = 0;
> + ssize_t coincident = 0;
> +
> + for (ssize_t i=0; i<genome1.NumLink(); ++i) {
> + ssize_t innovId = genome1.aLinkGenes[i].InnovationId();
> + ssize_t idx = genome2.GetLinkIndex(innovId);
> + if (idx != -1 && genome1.aLinkGenes[i].Enabled()) {
> + deltaW += std::abs(genome1.aLinkGenes[i].Weight() - genome2.aLinkGenes[idx].Weight());
Oh! I misunderstood. I think you are right.
---
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/a605eef0e349b0a08cc1a289c6857240c6ae5e23#r68588758
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160627/3784762b/attachment.html>
More information about the mlpack-git
mailing list