<p>No interpolation necessary; this is all just reshaping.  I thought that the idea was that a user passed in a matrix with each of the maximal hidden units in columns, and the user gets back a matrix where each maximal hidden unit has been reshaped into a block, and the matrix is made up of these blocks.  Please correct me if I'm misunderstanding.  Anyway, suppose you have the following maximal inputs:</p>

<pre><code>[[1 1 1 1]
 [2 2 2 2]
 [3 3 3 3]
 [4 4 4 4]]
</code></pre>

<p>and if we specify a padding of 1 and a padding value of 0, a block arrangement of 2x2, and an individual block size of 2x2, we get back</p>

<pre><code>[[0 0 0 0 0 0 0]
 [0 1 1 0 2 2 0]
 [0 1 1 0 2 2 0]
 [0 0 0 0 0 0 0]
 [0 3 3 0 4 4 0]
 [0 3 3 0 4 4 0]
 [0 0 0 0 0 0 0]]
</code></pre>

<p>Is that correct for what the function is supposed to do?  If so, we do still have some free parameters.  Maybe the user wants a different block size, like 1x4, so they get back</p>

<pre><code>[[0 0 0 0 0 0 0 0 0 0 0]
 [0 1 1 1 1 0 2 2 2 2 0]
 [0 0 0 0 0 0 0 0 0 0 0]
 [0 3 3 3 3 0 4 4 4 4 0]
 [0 0 0 0 0 0 0 0 0 0 0]]
</code></pre>

<p>Anyway, if we're on the same page about what the function should do, then I think that all that needs to be done to accomplish this is to modify the constructor of <code>ColumnsToBlocks(arma::uword rows, arma::uword cols)</code> to something more like <code>ColumnsToBlocks(arma::uword rows, arma::uword cols, arma::uword blockWidth, arma::uword blockHeight)</code> where <code>blockWidth * blockHeight</code> must be equal to the number of rows in the input matrix (so no interpolation is necessary).</p>

<p>(Also, as a side note, I'd suggest using <code>size_t</code> instead of <code>arma::uword</code> despite the fact that in some cases they may not be exactly the same type.  I'd like to force Armadillo to use <code>size_t</code> always, because <code>size_t</code> is a perfect type to represent indices, but I haven't yet figured out what needs to be done at configure time for that.)</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-158489256">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFE1Gya9JvTQwCdmjUR5aqp--iE8uks5pH2IRgaJpZM4GWT_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-158489256"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>