[mlpack-git] master: Minor style changes. (23b52db)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Sat Feb 28 17:53:27 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/de0988d27899f88e1b8d87817bad9152ccebf205...23b52dbf5a3db99d0c3094c59b33f6ac3f2131aa
>---------------------------------------------------------------
commit 23b52dbf5a3db99d0c3094c59b33f6ac3f2131aa
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date: Sat Feb 28 23:53:19 2015 +0100
Minor style changes.
>---------------------------------------------------------------
23b52dbf5a3db99d0c3094c59b33f6ac3f2131aa
src/mlpack/methods/ann/ffnn.hpp | 6 +++---
src/mlpack/methods/ann/layer/binary_classification_layer.hpp | 4 ++--
src/mlpack/methods/ann/layer/multiclass_classification_layer.hpp | 4 ++--
src/mlpack/methods/ann/performance_functions/cee_function.hpp | 2 +-
src/mlpack/methods/ann/performance_functions/mse_function.hpp | 2 +-
src/mlpack/methods/ann/performance_functions/sse_function.hpp | 2 +-
src/mlpack/methods/ann/rnn.hpp | 6 +++---
src/mlpack/tests/performance_functions_test.cpp | 6 +++---
8 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/mlpack/methods/ann/ffnn.hpp b/src/mlpack/methods/ann/ffnn.hpp
index 8cfb347..314f66d 100644
--- a/src/mlpack/methods/ann/ffnn.hpp
+++ b/src/mlpack/methods/ann/ffnn.hpp
@@ -238,13 +238,13 @@ class FFNN
VecType& error)
{
// Calculate and store the output error.
- outputLayer.calculateError(std::get<0>(
+ outputLayer.CalculateError(std::get<0>(
std::get<sizeof...(Tp) - 1>(t)).OutputLayer().InputActivation(),
target, error);
// Masures the network's performance with the specified performance
// function.
- return PerformanceFunction::error(std::get<0>(
+ return PerformanceFunction::Error(std::get<0>(
std::get<sizeof...(Tp) - 1>(t)).OutputLayer().InputActivation(),
target);
}
@@ -256,7 +256,7 @@ class FFNN
void OutputPrediction(std::tuple<Tp...>& t, VecType& output)
{
// Calculate and store the output prediction.
- outputLayer.outputClass(std::get<0>(
+ outputLayer.OutputClass(std::get<0>(
std::get<sizeof...(Tp) - 1>(t)).OutputLayer().InputActivation(),
output);
}
diff --git a/src/mlpack/methods/ann/layer/binary_classification_layer.hpp b/src/mlpack/methods/ann/layer/binary_classification_layer.hpp
index c928f7d..109895d 100644
--- a/src/mlpack/methods/ann/layer/binary_classification_layer.hpp
+++ b/src/mlpack/methods/ann/layer/binary_classification_layer.hpp
@@ -45,7 +45,7 @@ class BinaryClassificationLayer
* @param error The calculated error with respect to the input activation and
* the given target.
*/
- void calculateError(const VecType& inputActivations,
+ void CalculateError(const VecType& inputActivations,
const VecType& target,
VecType& error)
{
@@ -58,7 +58,7 @@ class BinaryClassificationLayer
* @param inputActivations Input data used to calculate the output class.
* @param output Output class of the input activation.
*/
- void outputClass(const VecType& inputActivations, VecType& output)
+ void OutputClass(const VecType& inputActivations, VecType& output)
{
output = inputActivations;
output.transform( [](double value) { return (value > 0.5 ? 1 : 0); } );
diff --git a/src/mlpack/methods/ann/layer/multiclass_classification_layer.hpp b/src/mlpack/methods/ann/layer/multiclass_classification_layer.hpp
index 40ca62b..2c8807f 100644
--- a/src/mlpack/methods/ann/layer/multiclass_classification_layer.hpp
+++ b/src/mlpack/methods/ann/layer/multiclass_classification_layer.hpp
@@ -49,7 +49,7 @@ class MulticlassClassificationLayer
* @param error The calculated error with respect to the input activation and
* the given target.
*/
- void calculateError(const VecType& inputActivations,
+ void CalculateError(const VecType& inputActivations,
const VecType& target,
VecType& error)
{
@@ -62,7 +62,7 @@ class MulticlassClassificationLayer
* @param inputActivations Input data used to calculate the output class.
* @param output Output class of the input activation.
*/
- void outputClass(const VecType& inputActivations, VecType& output)
+ void OutputClass(const VecType& inputActivations, VecType& output)
{
output = inputActivations;
}
diff --git a/src/mlpack/methods/ann/performance_functions/cee_function.hpp b/src/mlpack/methods/ann/performance_functions/cee_function.hpp
index 0113694..66b5471 100644
--- a/src/mlpack/methods/ann/performance_functions/cee_function.hpp
+++ b/src/mlpack/methods/ann/performance_functions/cee_function.hpp
@@ -39,7 +39,7 @@ class CrossEntropyErrorFunction
* @param target Target data.
* @return cross-entropy error.
*/
- static double error(const VecType& input, const VecType& target)
+ static double Error(const VecType& input, const VecType& target)
{
if (LayerTraits<Layer>::IsBinary)
return -arma::dot(arma::trunc_log(arma::abs(target - input)), target);
diff --git a/src/mlpack/methods/ann/performance_functions/mse_function.hpp b/src/mlpack/methods/ann/performance_functions/mse_function.hpp
index cd59c3d..ebe29f5 100644
--- a/src/mlpack/methods/ann/performance_functions/mse_function.hpp
+++ b/src/mlpack/methods/ann/performance_functions/mse_function.hpp
@@ -29,7 +29,7 @@ class MeanSquaredErrorFunction
* @param target Target data.
* @return mean of squared errors.
*/
- static double error(const VecType& input, const VecType& target)
+ static double Error(const VecType& input, const VecType& target)
{
return arma::mean(arma::square(target - input));
}
diff --git a/src/mlpack/methods/ann/performance_functions/sse_function.hpp b/src/mlpack/methods/ann/performance_functions/sse_function.hpp
index b88e5a2..01b5418 100644
--- a/src/mlpack/methods/ann/performance_functions/sse_function.hpp
+++ b/src/mlpack/methods/ann/performance_functions/sse_function.hpp
@@ -29,7 +29,7 @@ class SumSquaredErrorFunction
* @param target Target data.
* @return sum of squared errors.
*/
- static double error(const VecType& input, const VecType& target)
+ static double Error(const VecType& input, const VecType& target)
{
return arma::sum(arma::square(target - input));
}
diff --git a/src/mlpack/methods/ann/rnn.hpp b/src/mlpack/methods/ann/rnn.hpp
index a4a085b..a8dcc6d 100644
--- a/src/mlpack/methods/ann/rnn.hpp
+++ b/src/mlpack/methods/ann/rnn.hpp
@@ -356,7 +356,7 @@ class RNN
VecType& error)
{
// Calculate and store the output error.
- outputLayer.calculateError(std::get<0>(
+ outputLayer.CalculateError(std::get<0>(
std::get<sizeof...(Tp) - 1>(t)).OutputLayer().InputActivation(),
target, error);
@@ -366,7 +366,7 @@ class RNN
// Masures the network's performance with the specified performance
// function.
- err = PerformanceFunction::error(std::get<0>(
+ err = PerformanceFunction::Error(std::get<0>(
std::get<sizeof...(Tp) - 1>(t)).OutputLayer().InputActivation(),
target);
@@ -381,7 +381,7 @@ class RNN
void OutputPrediction(std::tuple<Tp...>& t, VecType& output)
{
// Calculate and store the output prediction.
- outputLayer.outputClass(std::get<0>(
+ outputLayer.OutputClass(std::get<0>(
std::get<sizeof...(Tp) - 1>(t)).OutputLayer().InputActivation(),
output);
}
diff --git a/src/mlpack/tests/performance_functions_test.cpp b/src/mlpack/tests/performance_functions_test.cpp
index 82372b0..31eec7e 100644
--- a/src/mlpack/tests/performance_functions_test.cpp
+++ b/src/mlpack/tests/performance_functions_test.cpp
@@ -24,7 +24,7 @@ BOOST_AUTO_TEST_CASE(MeanSquaredErrorTest)
arma::colvec input("1.0 0.0 1.0 0.0 -1.0 0.0 -1.0 0.0");
arma::colvec target = arma::zeros<arma::colvec>(8);
- BOOST_REQUIRE_EQUAL(MeanSquaredErrorFunction<>::error(input, target), 0.5);
+ BOOST_REQUIRE_EQUAL(MeanSquaredErrorFunction<>::Error(input, target), 0.5);
}
// Test the cross entropy performance function.
@@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(CrossEntropyErrorTest)
input << std::exp(-2.0) << std::exp(-1.0);
arma::colvec target = arma::ones<arma::colvec>(2);
- BOOST_REQUIRE_EQUAL(CrossEntropyErrorFunction<>::error(input, target), 3);
+ BOOST_REQUIRE_EQUAL(CrossEntropyErrorFunction<>::Error(input, target), 3);
}
// Test the sum squared error performance function.
@@ -43,7 +43,7 @@ BOOST_AUTO_TEST_CASE(SumSquaredErrorTest)
arma::colvec input("1.0 0.0 1.0 0.0 -1.0 0.0 -1.0 0.0");
arma::colvec target = arma::zeros<arma::colvec>(8);
- BOOST_REQUIRE_EQUAL(SumSquaredErrorFunction<>::error(input, target), 4);
+ BOOST_REQUIRE_EQUAL(SumSquaredErrorFunction<>::Error(input, target), 4);
}
BOOST_AUTO_TEST_SUITE_END();
More information about the mlpack-git
mailing list