[mlpack-git] master: Remove the input parameter since we can't provide an input for batch learning and it wasn't used anyway. (4eb41ca)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Fri Jan 9 09:55:38 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/2c9cb2c2a51d74b42465aae892f29e1e4b842156...059a9b6e7da15e25151daae43e4a41d235f8c84c

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

commit 4eb41caabad6b682a1b2a64b539d7e50228b0860
Author: Marcus Edel <marcus.edel at fu-berlin.de>
Date:   Fri Jan 9 14:20:20 2015 +0100

    Remove the input parameter since we can't provide an input for batch learning and it wasn't used anyway.


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

4eb41caabad6b682a1b2a64b539d7e50228b0860
 src/mlpack/methods/ann/ffnn.hpp |  7 ++-----
 src/mlpack/methods/ann/rnn.hpp  | 25 ++++++++++++-------------
 2 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/src/mlpack/methods/ann/ffnn.hpp b/src/mlpack/methods/ann/ffnn.hpp
index 907782e..9611c85 100644
--- a/src/mlpack/methods/ann/ffnn.hpp
+++ b/src/mlpack/methods/ann/ffnn.hpp
@@ -91,13 +91,10 @@ class FFNN
     }
 
     /**
-     * Updating the weights using the specified optimizer and the given input.
+     * Updating the weights using the specified optimizer.
      *
-     * @param input Input data used to evaluate the network.
-     * @tparam VecType Type of data (arma::colvec, arma::mat or arma::sp_mat).
      */
-    template <typename VecType>
-    void ApplyGradients(const VecType& /* unused */)
+    void ApplyGradients()
     {
       gradientNum = 0;
       ApplyGradients(network);
diff --git a/src/mlpack/methods/ann/rnn.hpp b/src/mlpack/methods/ann/rnn.hpp
index d5862ad..c616aeb 100644
--- a/src/mlpack/methods/ann/rnn.hpp
+++ b/src/mlpack/methods/ann/rnn.hpp
@@ -130,18 +130,18 @@ class RNN
     }
 
     /**
-     * Updating the weights using the specified optimizer and the given input.
+     * Updating the weights using the specified optimizer.
      *
-     * @param input Input data used for evaluating the network.
-     * @tparam VecType Type of data (arma::colvec, arma::mat or arma::sp_mat).
      */
-    template <typename VecType>
-    void ApplyGradients(const VecType& input)
+    void ApplyGradients()
     {
       gradientNum = 0;
-      ApplyGradients(network, input);
+      ApplyGradients(network);
     }
 
+    //! Get the error of the network.
+    double Error() const { return err; }
+
   private:
     /**
      * Helper function to reset the network by zeroing the layer activations.
@@ -335,7 +335,7 @@ class RNN
     }
 
     /**
-     * Sum up all gradients and store the  results in the gradients storage.
+     * Sum up all gradients and store the results in the gradients storage.
      *
      * enable_if (SFINAE) is used to iterate through the network connections.
      * The general case peels off the first type and recurses, as usual with
@@ -364,17 +364,16 @@ class RNN
      * connections, and one for the general case which peels off the first type
      * and recurses, as usual with variadic function templates.
      */
-    template<size_t I = 0, typename VecType, typename... Tp>
+    template<size_t I = 0, typename... Tp>
     typename std::enable_if<I == sizeof...(Tp) - 1, void>::type
-    ApplyGradients(std::tuple<Tp...>& /* unused */,
-                   const VecType& /* unused */) { }
+    ApplyGradients(std::tuple<Tp...>& /* unused */) { }
 
-    template<size_t I = 0, typename VecType, typename... Tp>
+    template<size_t I = 0, typename... Tp>
     typename std::enable_if<I < sizeof...(Tp) - 1, void>::type
-    ApplyGradients(std::tuple<Tp...>& t, const VecType& input)
+    ApplyGradients(std::tuple<Tp...>& t)
     {
       Gradients(std::get<I>(t));
-      ApplyGradients<I + 1, VecType, Tp...>(t, input);
+      ApplyGradients<I + 1, Tp...>(t);
     }
 
     /**



More information about the mlpack-git mailing list