[mlpack-git] master: Use the new optimizer interface. (99de0b6)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Fri Nov 13 12:45:35 EST 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/0f4e83dc9cc4dcdc315d2cceee32b23ebab114c2...7388de71d5398103ee3a0b32b4026902a40a67b3

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

commit 99de0b655fb99e9098faeb11bc3feaf4cb46607e
Author: marcus <marcus.edel at fu-berlin.de>
Date:   Fri Oct 30 19:59:33 2015 +0100

    Use the new optimizer interface.


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

99de0b655fb99e9098faeb11bc3feaf4cb46607e
 src/mlpack/methods/ann/optimizer/steepest_descent.hpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/methods/ann/optimizer/steepest_descent.hpp b/src/mlpack/methods/ann/optimizer/steepest_descent.hpp
index 5639979..44b18b7 100644
--- a/src/mlpack/methods/ann/optimizer/steepest_descent.hpp
+++ b/src/mlpack/methods/ann/optimizer/steepest_descent.hpp
@@ -34,7 +34,7 @@ class SteepestDescent
    * @param mom The momentum coefficient.
    */
   SteepestDescent(DecomposableFunctionType& function,
-                  const double lr = 1,
+                  const double lr = 0.5,
                   const double mom = 0) :
       function(function),
       lr(lr),
@@ -66,13 +66,12 @@ class SteepestDescent
   {
     if (gradient.n_elem != 0)
     {
-      DataType outputGradient;
-      function.Gradient(outputGradient);
+      DataType outputGradient = function.Gradient();
       gradient += outputGradient;
     }
     else
     {
-      function.Gradient(gradient);
+      gradient = function.Gradient();
     }
   }
 



More information about the mlpack-git mailing list