[mlpack-git] master: change Predict to const function (3d1aae4)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Mon Nov 16 10:08:38 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/9d882d9461a656dfec814b0ec7ae32bd4aebf8b2...7983dc9bfef684061f040667a69de75887cd2330

>---------------------------------------------------------------

commit 3d1aae40bbafd1caa011affca4545daa12ceb1da
Author: stereomatchingkiss <stereomatchingkiss at gmail.com>
Date:   Wed Nov 11 16:28:33 2015 +0800

    change Predict to const function


>---------------------------------------------------------------

3d1aae40bbafd1caa011affca4545daa12ceb1da
 src/mlpack/methods/softmax_regression/softmax_regression.hpp      | 2 +-
 src/mlpack/methods/softmax_regression/softmax_regression_impl.hpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/methods/softmax_regression/softmax_regression.hpp b/src/mlpack/methods/softmax_regression/softmax_regression.hpp
index a547ac6..25f96e8 100644
--- a/src/mlpack/methods/softmax_regression/softmax_regression.hpp
+++ b/src/mlpack/methods/softmax_regression/softmax_regression.hpp
@@ -111,7 +111,7 @@ class SoftmaxRegression
    * @param testData Matrix of data points for which predictions are to be made.
    * @param predictions Vector to store the predictions in.
    */
-  void Predict(const arma::mat& testData, arma::vec& predictions);
+  void Predict(const arma::mat& testData, arma::vec& predictions) const;
 
   /**
    * Computes accuracy of the learned model given the feature data and the
diff --git a/src/mlpack/methods/softmax_regression/softmax_regression_impl.hpp b/src/mlpack/methods/softmax_regression/softmax_regression_impl.hpp
index 43f6e01..db4d890 100644
--- a/src/mlpack/methods/softmax_regression/softmax_regression_impl.hpp
+++ b/src/mlpack/methods/softmax_regression/softmax_regression_impl.hpp
@@ -58,7 +58,7 @@ SoftmaxRegression<OptimizerType>::SoftmaxRegression(
 
 template<template<typename> class OptimizerType>
 void SoftmaxRegression<OptimizerType>::Predict(const arma::mat& testData,
-                                               arma::vec& predictions)
+                                               arma::vec& predictions) const
 {
   // Calculate the probabilities for each test input.
   arma::mat hypothesis, probabilities;



More information about the mlpack-git mailing list