[mlpack-git] master: No need to change the sign afterwards. (6404eff)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Mon Jan 19 15:49:09 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/e9a2a57c33d1a77ac563e571146d9824b23a52d7...6404effcf41eb976fdf9d45d0903b765c0e04dd0
>---------------------------------------------------------------
commit 6404effcf41eb976fdf9d45d0903b765c0e04dd0
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date: Mon Jan 19 21:48:55 2015 +0100
No need to change the sign afterwards.
>---------------------------------------------------------------
6404effcf41eb976fdf9d45d0903b765c0e04dd0
.../methods/ann/layer/binary_classification_layer.hpp | 2 +-
.../methods/ann/layer/multiclass_classification_layer.hpp | 15 +++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/mlpack/methods/ann/layer/binary_classification_layer.hpp b/src/mlpack/methods/ann/layer/binary_classification_layer.hpp
index 0710ffd..c3e38f1 100644
--- a/src/mlpack/methods/ann/layer/binary_classification_layer.hpp
+++ b/src/mlpack/methods/ann/layer/binary_classification_layer.hpp
@@ -49,7 +49,7 @@ class BinaryClassificationLayer
const VecType& target,
VecType& error)
{
- error = -(target - inputActivations);
+ error = inputActivations - target;
}
/*
diff --git a/src/mlpack/methods/ann/layer/multiclass_classification_layer.hpp b/src/mlpack/methods/ann/layer/multiclass_classification_layer.hpp
index 797954a..aa9a57e 100644
--- a/src/mlpack/methods/ann/layer/multiclass_classification_layer.hpp
+++ b/src/mlpack/methods/ann/layer/multiclass_classification_layer.hpp
@@ -18,7 +18,7 @@ namespace ann /** Artificial Neural Network. */ {
* An implementation of a multiclass classification layer that can be used as
* output layer.
*
- * * A convenience typedef is given:
+ * A convenience typedef is given:
*
* - ClassificationLayer
*
@@ -53,7 +53,18 @@ class MulticlassClassificationLayer
const VecType& target,
VecType& error)
{
- error = -(target - inputActivations);
+ error = inputActivations - target;
+ }
+
+ /*
+ * Calculate the output class using the specified input activation.
+ *
+ * @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)
+ {
+ output = inputActivations;
}
}; // class MulticlassClassificationLayer
More information about the mlpack-git
mailing list