<p>Thanks for the contribution. I made a couple of changes:</p>

<ul>
<li>moved the main sparse autoencoder into a separate folder in <a href="https://github.com/mlpack/mlpack/commit/4ad39f8651da0efd9e4cb8d5fe59bbb5211b6375" class="commit-link"><tt>4ad39f8</tt></a>
</li>
<li>minor formatting and comment fixes in 896937d03c5eb32a4e980</li>
<li>modified the sparse autoencoder test in <a href="https://github.com/mlpack/mlpack/commit/443ecdcd35d79a56ff21de3d518d583eecf1f50e" class="commit-link"><tt>443ecdc</tt></a>, so that it uses the SparseAutoencoder class you already implemented. Since we already have a gradient test for each activation function, I removed the gradient sparse autoencoder test.</li>
</ul>

<p>Let me know if I messed anything up.</p>

<p>Since, we have this nice SparseAutoencoder class, it should be easy provide a reverse-compatibility layer for the 2.x.x releases. I'll go and write the necessary code, if nobody really likes to do it. </p>

<p>We should also think about a test case that tests the code in combination with an optimizer. I run into a couple of problems, once I tested the code with the existing trainer class. I solved the issues in <a href="https://github.com/mlpack/mlpack/commit/f34ae33e2ccdaca68dc796a8384d409b586dd183" class="commit-link"><tt>f34ae33</tt></a>. Another test could also test the ability to work with additional layer. We only test the standard sparse autoencoder model structure (input layer, hidden layer, output layer). Wich is fine since the former code uses this static model structure, but since we build the sparse autoencoder using the ann modules, we have the ability to add a bunch of interesting layer, e.g. Dropout layer.</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/451#issuecomment-177687178">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFIM1D3zD5DcY6WFR7iSDt7g3N82Iks5pfqnsgaJpZM4GAqt4.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/451#issuecomment-177687178"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>