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

<p>If you want to specify rows and cols, then we would need some sort of interpolation algorithms(ex : bilinearInterpolation)</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-153637486">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFPEhpaZcT8C0Pf_-mG1OewvoIDxMks5pCbxHgaJpZM4GWT_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-153637486"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>