[mlpack-git] [mlpack/mlpack] Neural evolution algorithms implementation (CNE, NEAT, HyperNEAT) (#686)

Marcus Edel notifications at github.com
Sat Jul 16 14:48:50 EDT 2016


Maybe useful, I use the following function in the Genome class to print the lastBestGenome in the neat Reproduce function:

```
void Print()
 {
    std::cout << "--------------------------------------------------------------------------\n";
    const char* enumNeuronTypetring[] = { "NONE", "INPUT", "BIAS", "HIDDEN", "OUTPUT" };
    const char* enumActivationFuncTypeString[] = { "SIGMOID", "TANH", "LINEAR", "RELU" };
    const char* boolEnabledString[] = { "False", "True" };

    std::cout << "Genes: " << aNeuronGenes.size() << std::endl;

    for(size_t i = 0; i < aNeuronGenes.size(); ++i)
    {
      printf("  Gene:(id=%i, type=%s, activation=%s, response=%f, depth=%.3f)\n",
          aNeuronGenes[i].Id(),
          enumNeuronTypetring[aNeuronGenes[i].Type()],
          enumActivationFuncTypeString[aNeuronGenes[i].ActFuncType()],
          aNeuronGenes[i].Activation(),
          aNeuronGenes[i].Depth());
    }

    std::cout << "Links: " << aLinkGenes.size() << std::endl;

    for(size_t i = 0; i < aLinkGenes.size(); ++i)
    {
      printf("  Link:(in=%i, out=%i, weight=%f, enabled=%s innovation=%i)\n",
          aLinkGenes[i].FromNeuronId(),
          aLinkGenes[i].ToNeuronId(),
          aLinkGenes[i].Weight(),
          boolEnabledString[aLinkGenes[i].Enabled()],
          aLinkGenes[i].InnovationId());
    }

    std::cout << "--------------------------------------------------------------------------\n";
 }
```

---
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#issuecomment-233145071
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160716/b74c742b/attachment.html>


More information about the mlpack-git mailing list