<blockquote>
<p>why arma::vec&amp; but not arma::Row?</p>
</blockquote>

<p>The Armadillo storage format is column-major, so inside mlpack C++ code, a column (either arma::mat::col() or arma::vec, arma::Col, etc.) refers to a data point.</p>

<blockquote>
<p>To work with SGD, I have to implement three more functions</p>
</blockquote>

<p>Nah, you shouldn't have to do anything at all.  You can use the SoftmaxRegression class with the L-BFGS optimizer like this:</p>

<p><code>SoftmaxRegression&lt;L_BFGS&gt;</code></p>

<p>and with the SGD optimizer like this:</p>

<p><code>SoftmaxRegression&lt;SGD&gt;</code></p>

<p>So you shouldn't need to modify any of the existing code.  Take a look at <code>src/mlpack/methods/nca/nca_main.cpp</code> and how the --optimizer option is implemented there; it should be like that, pretty straightforward.  I hope that clarifies things a bit.</p>

<blockquote>
<p>We could rely on the huge libraries developed by NVDIA and other open source community. Like  mshadow(<a href="https://github.com/dmlc/mshadow">https://github.com/dmlc/mshadow</a>) and Thrust(<a href="http://docs.nvidia.com/cuda/thrust/">http://docs.nvidia.com/cuda/thrust/</a>).</p>

<p>mshadow provide high level api for matrix operation like armadillo, Thrust provide stl like general purpose algorithms.</p>
</blockquote>

<p>Excellent, I will take a look into these when I have some time.  Thanks for the links!</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/466#issuecomment-154902110">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFHgZIBENh6uMntQD3b164CsebNgHks5pD_XngaJpZM4GX7Ld.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/466#issuecomment-154902110"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>