[mlpack-git] master: No need to change the sign afterwards. (59ad65d)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:13:16 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

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

commit 59ad65da5124a513a7abe16055e09b1fe123d0d3
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.


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

59ad65da5124a513a7abe16055e09b1fe123d0d3
 .../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