<p>Maybe useful, I use the following function in the Genome class to print the lastBestGenome in the neat Reproduce function:</p>
<pre><code>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";
}
</code></pre>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/686#issuecomment-233145071">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFBBRObdkyMybflnKUaVj0RJ2zBAUks5qWSeSgaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFGJvUDOIuW26Hd4gwAfWALcP1xOsks5qWSeSgaJpZM4IwJa6.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/686#issuecomment-233145071"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>