<p>Ooh this is a really neat idea, this totally eliminates the function parameter. This would also make the serialization easier, the only drawback I see so far is that any layer that currently holds an optimizer has to implement three more functions.</p>

<p>In <a href="https://github.com/mlpack/mlpack/issues/513" class="issue-link js-issue-link" data-url="https://github.com/mlpack/mlpack/issues/513" data-id="130173803" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#513</a> <a href="https://github.com/stereomatchingkiss" class="user-mention">@stereomatchingkiss</a> suggested a switch from a reference to pointers to hold the function to be optimized. Primarily, to support serialization for the existing layer. Since <a href="https://github.com/stereomatchingkiss" class="user-mention">@stereomatchingkiss</a> worked on the problem I would like to hear his opinion about this.</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/pull/519#issuecomment-182657809">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFK_pWf4Viml5JZxIodo_VPDifVH3ks5pi8-lgaJpZM4HWwxL.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/519#issuecomment-182657809"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>