<p>I am using C++14 (C++1y) and what I did was train the model and then just return net (which is the FFN) and saved it to another auto'd variable from main. However, when I called predict on that, I got a segfault. My guess is somewhere, somehow, while getting returned from BuildFFN, the variable net got corrupted. Personally, I would prefer if this worked well (because my machine has around 32gb of memory so holding data is not a problem). Perhaps, we could look into why this segfault occrus? </p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/issues/531#issuecomment-191004782">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFAMG4hqWs6_xVAN-QMB8hQiYiLUfks5ppOUCgaJpZM4HmbCC.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/issues/531#issuecomment-191004782"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>