<blockquote>
<p>If using golden model, I think we can skip the training process but feed the data MaximalInputs directly.</p>
</blockquote>

<p>Ah, I agree, no need to train the autoencoder at all.</p>

<blockquote>
<p>Sure, the check I want to perform is ...</p>
</blockquote>

<p>Taking a look over this made me realize that the output format for <code>MaximalInputs()</code> is not what I thought; I must have misunderstood.  It looks to me like <code>MaximalInputs()</code> will output a matrix that has each maximal input as a submatrix of the output matrix.  But because autoencoders aren't going to be applied only to images, we shouldn't write <code>MaximalInputs()</code> in a way that assumes an image application.  So I think that each column of the output matrix should correspond to a maximal input; that is, <code>output.col(0)</code> should correspond to the maximal input for hidden node 0, <code>output.col(1)</code> should correspond to the maximal input for hidden node 1, and so forth.</p>

<p>Then a user can do the postprocessing to save as PGM themselves, either as a snippet of standalone code or as a function.  If you wanted to add a function that prepared the output to save to PGM, that's fine, but my primary concern is that we provide tools that are general enough for all applications.  Maybe something like <code>ColumnsToBlocks(const arma::mat&amp; maximalInputs, arma::mat&amp; output, const size_t blockRows, const size_t blockCols)</code>, which could be used like this:</p>

<pre><code>size_t rows, cols; // These get set to the size of the images.
arma::mat maximalInputs, parameters, output;
MaximalInputs(parameters, maximalInputs, 0, 255);
ColumnsToBlocks(maximalInputs, output, rows, cols);
data::Save("file.pgm", output);
</code></pre>

<p>Also, I think that there should be a <code>bool</code> parameter to <code>MaximalInputs()</code> to determine whether or not the output is going to be rescaled (I'd default it to false, because not all applications are image applications).</p>

<p>What do you think; is this a reasonable change?  I don't want to change so much that it becomes impossible to do what you were trying to do, but I do want to try and keep things general.</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/465#issuecomment-152173899">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFAnuVXx7RvpTz75WmFQ0bR7-HdbJks5pAhDmgaJpZM4GWT_f.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/465#issuecomment-152173899"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>