[mlpack-git] master: fix styles (9e3c882)
gitdub at mlpack.org
gitdub at mlpack.org
Tue Jun 14 21:13:05 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/4fa39b6ab0baa1428116d0406264b5452e716d06...97402b9098d9d72889aa795923cf8fd67a4d87bf
>---------------------------------------------------------------
commit 9e3c882d93bf54d4d8c67e0cede0a27581801853
Author: Keon Kim <kwk236 at gmail.com>
Date: Wed Jun 15 10:13:05 2016 +0900
fix styles
>---------------------------------------------------------------
9e3c882d93bf54d4d8c67e0cede0a27581801853
src/mlpack/methods/emst/emst_main.cpp | 4 +--
src/mlpack/methods/hmm/hmm_generate_main.cpp | 4 +--
src/mlpack/methods/hmm/hmm_viterbi_main.cpp | 4 +--
.../linear_regression/linear_regression_main.cpp | 4 +--
src/mlpack/methods/mvu/mvu_main.cpp | 4 +--
.../softmax_regression/softmax_regression_main.cpp | 39 ++++++++++------------
6 files changed, 28 insertions(+), 31 deletions(-)
diff --git a/src/mlpack/methods/emst/emst_main.cpp b/src/mlpack/methods/emst/emst_main.cpp
index 7efea0a..ddd3e03 100644
--- a/src/mlpack/methods/emst/emst_main.cpp
+++ b/src/mlpack/methods/emst/emst_main.cpp
@@ -56,8 +56,8 @@ int main(int argc, char* argv[])
const string outputFile= CLI::GetParam<string>("output_file");
if (CLI::HasParam("output_file"))
- Log::Warn << "--output_file (-o) is not specified;"
- << "no results will be saved!" << endl;
+ Log::Warn << "--output_file (-o) is not specified; no results will be "
+ << "saved!" << endl;
arma::mat dataPoints;
data::Load(inputFile, dataPoints, true);
diff --git a/src/mlpack/methods/hmm/hmm_generate_main.cpp b/src/mlpack/methods/hmm/hmm_generate_main.cpp
index 49dd646..53d45dc 100644
--- a/src/mlpack/methods/hmm/hmm_generate_main.cpp
+++ b/src/mlpack/methods/hmm/hmm_generate_main.cpp
@@ -77,8 +77,8 @@ int main(int argc, char** argv)
CLI::ParseCommandLine(argc, argv);
if (CLI::HasParam("output_file"))
- Log::Warn << "--output_file (-o) is not specified;"
- << "no results will be saved!" << endl;
+ Log::Warn << "--output_file (-o) is not specified; no results will be "
+ << "saved!" << endl;
// Set random seed.
if (CLI::GetParam<int>("seed") != 0)
diff --git a/src/mlpack/methods/hmm/hmm_viterbi_main.cpp b/src/mlpack/methods/hmm/hmm_viterbi_main.cpp
index 31275a0..562c291 100644
--- a/src/mlpack/methods/hmm/hmm_viterbi_main.cpp
+++ b/src/mlpack/methods/hmm/hmm_viterbi_main.cpp
@@ -74,8 +74,8 @@ int main(int argc, char** argv)
CLI::ParseCommandLine(argc, argv);
if (CLI::HasParam("output_file"))
- Log::Warn << "--output_file (-o) is not specified;"
- << "no results will be saved!" << endl;
+ Log::Warn << "--output_file (-o) is not specified; no results will be "
+ << "saved!" << endl;
const string modelFile = CLI::GetParam<string>("model_file");
LoadHMMAndPerformAction<Viterbi>(modelFile);
diff --git a/src/mlpack/methods/linear_regression/linear_regression_main.cpp b/src/mlpack/methods/linear_regression/linear_regression_main.cpp
index 1871acf..a764ed8 100644
--- a/src/mlpack/methods/linear_regression/linear_regression_main.cpp
+++ b/src/mlpack/methods/linear_regression/linear_regression_main.cpp
@@ -56,9 +56,9 @@ int main(int argc, char* argv[])
const string inputModelFile = CLI::GetParam<string>("input_model_file");
const string outputModelFile = CLI::GetParam<string>("output_model_file");
const string outputPredictionsFile =
- CLI::GetParam<string>("output_predictions");
+ CLI::GetParam<string>("output_predictions");
const string trainingResponsesFile =
- CLI::GetParam<string>("training_responses");
+ CLI::GetParam<string>("training_responses");
const string testFile = CLI::GetParam<string>("test_file");
const string trainFile = CLI::GetParam<string>("training_file");
const double lambda = CLI::GetParam<double>("lambda");
diff --git a/src/mlpack/methods/mvu/mvu_main.cpp b/src/mlpack/methods/mvu/mvu_main.cpp
index 976b0d3..4ca10f6 100644
--- a/src/mlpack/methods/mvu/mvu_main.cpp
+++ b/src/mlpack/methods/mvu/mvu_main.cpp
@@ -38,8 +38,8 @@ int main(int argc, char **argv)
const int numNeighbors = CLI::GetParam<int>("num_neighbors");
if (CLI::HasParam("output_file"))
- Log::Warn << "--output_file (-o) is not specified;"
- << "no results will be saved!" << endl;
+ Log::Warn << "--output_file (-o) is not specified; no results will be "
+ << "saved!" << endl;
RandomSeed(time(NULL));
diff --git a/src/mlpack/methods/softmax_regression/softmax_regression_main.cpp b/src/mlpack/methods/softmax_regression/softmax_regression_main.cpp
index 7f211a6..63f3be9 100644
--- a/src/mlpack/methods/softmax_regression/softmax_regression_main.cpp
+++ b/src/mlpack/methods/softmax_regression/softmax_regression_main.cpp
@@ -80,10 +80,10 @@ void TestPredictAcc(const string& testFile,
// Build the softmax model given the parameters.
template<typename Model>
-std::unique_ptr<Model> TrainSoftmax(const string& trainingFile,
- const string& labelsFile,
- const string& inputModelFile,
- const size_t maxIterations);
+unique_ptr<Model> TrainSoftmax(const string& trainingFile,
+ const string& labelsFile,
+ const string& inputModelFile,
+ const size_t maxIterations);
int main(int argc, char** argv)
{
@@ -91,16 +91,13 @@ int main(int argc, char** argv)
CLI::ParseCommandLine(argc, argv);
- const std::string trainingFile = CLI::GetParam<std::string>("training_file");
- const std::string labelsFile = CLI::GetParam<std::string>("labels_file");
-
- const std::string inputModelFile =
- CLI::GetParam<std::string>("input_model_file");
+ const string trainingFile = CLI::GetParam<string>("training_file");
+ const string labelsFile = CLI::GetParam<string>("labels_file");
+ const string inputModelFile = CLI::GetParam<string>("input_model_file");
const string outputModelFile = CLI::GetParam<string>("output_model_file");
const string testLabelsFile = CLI::GetParam<string>("test_labels");
const int maxIterations = CLI::GetParam<int>("max_iterations");
- const string predictionsFile =
- CLI::GetParam<string>("predictions_file");
+ const string predictionsFile = CLI::GetParam<string>("predictions_file");
// One of inputFile and modelFile must be specified.
if (!CLI::HasParam("input_model_file") && !CLI::HasParam("training_file"))
@@ -120,12 +117,12 @@ int main(int argc, char** argv)
!CLI::HasParam("test_labels") &&
!CLI::HasParam("predictions_file"))
Log::Warn << "None of --output_model_file, --test_labels, or "
- << "--predictions_file are set; no results from this program "
- << " will be saved." << endl;
+ << "--predictions_file are set; no results from this program will be "
+ << "saved." << endl;
using SM = regression::SoftmaxRegression<>;
- std::unique_ptr<SM> sm = TrainSoftmax<SM>(trainingFile,
+ unique_ptr<SM> sm = TrainSoftmax<SM>(trainingFile,
labelsFile,
inputModelFile,
maxIterations);
@@ -136,7 +133,7 @@ int main(int argc, char** argv)
sm->NumClasses(), *sm);
if (CLI::HasParam("output_model_file"))
- data::Save(CLI::GetParam<std::string>("output_model_file"),
+ data::Save(CLI::GetParam<string>("output_model_file"),
"softmax_regression_model", *sm, true);
}
@@ -145,8 +142,8 @@ size_t CalculateNumberOfClasses(const size_t numClasses,
{
if (numClasses == 0)
{
- const std::set<size_t> unique_labels(std::begin(trainLabels),
- std::end(trainLabels));
+ const set<size_t> unique_labels(begin(trainLabels),
+ end(trainLabels));
return unique_labels.size();
}
else
@@ -208,8 +205,8 @@ void TestPredictAcc(const string& testFile,
<< testLabels.n_elem << " labels!" << endl;
}
- std::vector<size_t> bingoLabels(numClasses, 0);
- std::vector<size_t> labelSize(numClasses, 0);
+ vector<size_t> bingoLabels(numClasses, 0);
+ vector<size_t> labelSize(numClasses, 0);
for (arma::uword i = 0; i != predictLabels.n_elem; ++i)
{
if (predictLabels(i) == testLabels(i))
@@ -235,7 +232,7 @@ void TestPredictAcc(const string& testFile,
}
template<typename Model>
-std::unique_ptr<Model> TrainSoftmax(const string& trainingFile,
+unique_ptr<Model> TrainSoftmax(const string& trainingFile,
const string& labelsFile,
const string& inputModelFile,
const size_t maxIterations)
@@ -244,7 +241,7 @@ std::unique_ptr<Model> TrainSoftmax(const string& trainingFile,
using SRF = regression::SoftmaxRegressionFunction;
- std::unique_ptr<Model> sm;
+ unique_ptr<Model> sm;
if (!inputModelFile.empty())
{
sm.reset(new Model(0, 0, false));
More information about the mlpack-git
mailing list