[mlpack-git] master: Minor syntax and formatting changes. (7a8b0e1)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Wed Sep 30 09:36:24 EDT 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/dc2c5c68dc4bfcdd2075b1a0fd2d641fce651669...7a8b0e1292677b71888fad313772c63bcf0e7b80
>---------------------------------------------------------------
commit 7a8b0e1292677b71888fad313772c63bcf0e7b80
Author: Ryan Curtin <ryan at ratml.org>
Date: Wed Sep 30 09:35:05 2015 -0400
Minor syntax and formatting changes.
>---------------------------------------------------------------
7a8b0e1292677b71888fad313772c63bcf0e7b80
.../softmax_regression_function.cpp | 29 +++++++++++-----------
.../softmax_regression_function.hpp | 27 +++++++++++---------
2 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/src/mlpack/methods/softmax_regression/softmax_regression_function.cpp b/src/mlpack/methods/softmax_regression/softmax_regression_function.cpp
index a3417af..3257015 100644
--- a/src/mlpack/methods/softmax_regression/softmax_regression_function.cpp
+++ b/src/mlpack/methods/softmax_regression/softmax_regression_function.cpp
@@ -9,11 +9,12 @@
using namespace mlpack;
using namespace mlpack::regression;
-SoftmaxRegressionFunction::SoftmaxRegressionFunction(const arma::mat& data,
- const arma::Row<size_t>& labels,
- const size_t numClasses,
- const double lambda,
- const bool fitIntercept) :
+SoftmaxRegressionFunction::SoftmaxRegressionFunction(
+ const arma::mat& data,
+ const arma::Row<size_t>& labels,
+ const size_t numClasses,
+ const double lambda,
+ const bool fitIntercept) :
data(data),
numClasses(numClasses),
lambda(lambda),
@@ -36,21 +37,21 @@ const arma::mat SoftmaxRegressionFunction::InitializeWeights()
return InitializeWeights(data.n_rows, numClasses, fitIntercept);
}
-const arma::mat SoftmaxRegressionFunction::
-InitializeWeights(const size_t featureSize,
- const size_t numClasses,
- const bool fitIntercept)
+const arma::mat SoftmaxRegressionFunction::InitializeWeights(
+ const size_t featureSize,
+ const size_t numClasses,
+ const bool fitIntercept)
{
arma::mat parameters;
InitializeWeights(parameters, featureSize, numClasses, fitIntercept);
return parameters;
}
-void SoftmaxRegressionFunction::
-InitializeWeights(arma::mat &weights,
- const size_t featureSize,
- const size_t numClasses,
- const bool fitIntercept)
+void SoftmaxRegressionFunction::InitializeWeights(
+ arma::mat &weights,
+ const size_t featureSize,
+ const size_t numClasses,
+ const bool fitIntercept)
{
// Initialize values to 0.005 * r. 'r' is a matrix of random values taken from
// a Gaussian distribution with mean zero and variance one.
diff --git a/src/mlpack/methods/softmax_regression/softmax_regression_function.hpp b/src/mlpack/methods/softmax_regression/softmax_regression_function.hpp
index e56355f..7a69044 100644
--- a/src/mlpack/methods/softmax_regression/softmax_regression_function.hpp
+++ b/src/mlpack/methods/softmax_regression/softmax_regression_function.hpp
@@ -37,25 +37,26 @@ class SoftmaxRegressionFunction
const arma::mat InitializeWeights();
/**
- * Initialize Softmax Regression weights(trainable parameters) with
- * the given parameters.
- * @param featureSize The features size of the training set
+ * Initialize Softmax Regression weights (trainable parameters) with the given
+ * parameters.
+ *
+ * @param featureSize The number of features in the training set.
* @param numClasses Number of classes for classification.
- * @param fitIntercept Intercept term flag.
- * @return weights after initialize
+ * @param fitIntercept If true, an intercept is fitted.
+ * @return Initialized model weights.
*/
static const arma::mat InitializeWeights(const size_t featureSize,
const size_t numClasses,
const bool fitIntercept = false);
/**
- * Initialize Softmax Regression weights(trainable parameters) with
- * the given parameters.
- * @paaram weights weights want to initialize
- * @param featureSize The features size of the training set
+ * Initialize Softmax Regression weights (trainable parameters) with the given
+ * parameters.
+ *
+ * @param weights This will be filled with the initialized model weights.
+ * @param featureSize The number of features in the training set.
* @param numClasses Number of classes for classification.
* @param fitIntercept Intercept term flag.
- * @return weights after initialize
*/
static void InitializeWeights(arma::mat &weights,
const size_t featureSize,
@@ -113,8 +114,10 @@ class SoftmaxRegressionFunction
//! Gets the features size of the training data
size_t FeatureSize() const
- { return fitIntercept ? initialPoint.n_cols - 1 :
- initialPoint.n_cols; }
+ {
+ return fitIntercept ? initialPoint.n_cols - 1 :
+ initialPoint.n_cols;
+ }
//! Sets the regularization parameter.
double& Lambda() { return lambda; }
More information about the mlpack-git
mailing list