svrg_update.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_OPTIMIZERS_SVRG_SVRG_UPDATE_HPP
13 #define MLPACK_CORE_OPTIMIZERS_SVRG_SVRG_UPDATE_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace optimization {
19 
25 {
26  public:
35  void Initialize(const size_t /* rows */, const size_t /* cols */)
36  { /* Do nothing. */ }
37 
49  void Update(arma::mat& iterate,
50  const arma::mat& fullGradient,
51  const arma::mat& gradient,
52  const arma::mat& gradient0,
53  const size_t batchSize,
54  const double stepSize)
55  {
56  // Perform the vanilla SVRG update.
57  iterate -= stepSize * (fullGradient + (gradient - gradient0) /
58  (double) batchSize);
59  }
60 };
61 
62 } // namespace optimization
63 } // namespace mlpack
64 
65 #endif
.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
Vanilla update policy for Stochastic variance reduced gradient (SVRG).
Definition: svrg_update.hpp:24
void Update(arma::mat &iterate, const arma::mat &fullGradient, const arma::mat &gradient, const arma::mat &gradient0, const size_t batchSize, const double stepSize)
Update step for SVRG.
Definition: svrg_update.hpp:49
void Initialize(const size_t, const size_t)
The Initialize method is called by SVRG Optimizer method before the start of the iteration update pro...
Definition: svrg_update.hpp:35