random_descent.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_OPTIMIZERS_SCD_DESCENT_POLICIES_RANDOM_HPP
13 #define MLPACK_CORE_OPTIMIZERS_SCD_DESCENT_POLICIES_RANDOM_HPP
14 
15 #include <mlpack/core.hpp>
16 
17 namespace mlpack {
18 namespace optimization {
19 
38 {
39  public:
53  template <typename ResolvableFunctionType>
54  static size_t DescentFeature(const size_t /* iteration */,
55  const arma::mat& /* iterate */,
56  const ResolvableFunctionType& function)
57  {
58  return mlpack::math::RandInt(function.NumFeatures());
59  }
60 };
61 
62 } // namespace optimization
63 } // namespace mlpack
64 
65 #endif
.hpp
Definition: add_to_po.hpp:21
static size_t DescentFeature(const size_t, const arma::mat &, const ResolvableFunctionType &function)
The DescentFeature method is used to get the descent coordinate for the current iteration of the SCD ...
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
Random descent policy for Stochastic Coordinate Descent(SCD).
int RandInt(const int hiExclusive)
Generates a uniform random integer.
Definition: random.hpp:87