update_classic.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_OPTIMIZERS_FW_UPDATE_CLASSIC_HPP
13 #define MLPACK_CORE_OPTIMIZERS_FW_UPDATE_CLASSIC_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace optimization {
19 
30 {
31  public:
35  UpdateClassic() { /* Do nothing. */ }
36 
48  template<typename FunctionType>
49  void Update(FunctionType& /* function */,
50  const arma::mat& oldCoords,
51  const arma::mat& s,
52  arma::mat& newCoords,
53  const size_t numIter)
54  {
55  double gamma = 2.0 / (numIter + 2.0);
56  newCoords = (1.0 - gamma) * oldCoords + gamma * s;
57  }
58 };
59 
60 } // namespace optimization
61 } // namespace mlpack
62 
63 #endif
.hpp
Definition: add_to_po.hpp:21
UpdateClassic()
Construct the classic update rule for FrankWolfe algorithm.
The core includes that mlpack expects; standard C++ includes and Armadillo.
Use classic rule in the update step for FrankWolfe algorithm.
void Update(FunctionType &, const arma::mat &oldCoords, const arma::mat &s, arma::mat &newCoords, const size_t numIter)
Classic update rule for FrankWolfe.