sarah_update.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_OPTIMIZERS_SARAH_SARAH_UPDATE_HPP
13 #define MLPACK_CORE_OPTIMIZERS_SARAH_SARAH_UPDATE_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace optimization {
19 
24 {
25  public:
38  bool Update(arma::mat& iterate,
39  arma::mat& v,
40  const arma::mat& gradient,
41  const arma::mat& gradient0,
42  const size_t batchSize,
43  const double stepSize,
44  const double /* vNorm */)
45  {
46  v += (gradient - gradient0) / (double) batchSize;
47  iterate -= stepSize * v;
48  return false;
49  }
50 };
51 
52 } // namespace optimization
53 } // namespace mlpack
54 
55 #endif
.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
Vanilla update policy for SARAH.
bool Update(arma::mat &iterate, arma::mat &v, const arma::mat &gradient, const arma::mat &gradient0, const size_t batchSize, const double stepSize, const double)
Update step for SARAH.