12 #ifndef MLPACK_CORE_OPTIMIZERS_SCD_DESCENT_POLICIES_GREEDY_HPP 13 #define MLPACK_CORE_OPTIMIZERS_SCD_DESCENT_POLICIES_GREEDY_HPP 18 namespace optimization {
52 template <
typename ResolvableFunctionType>
54 const arma::mat& iterate,
55 const ResolvableFunctionType&
function)
57 size_t bestFeature = 0;
58 double bestDescent = 0;
59 for (
size_t i = 0; i <
function.NumFeatures(); ++i)
63 function.PartialGradient(iterate, i, fGrad);
65 double descent = arma::accu(fGrad);
66 if (descent > bestDescent)
69 bestDescent = descent;
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
Greedy descent policy for Stochastic Co-ordinate Descent(SCD).
static size_t DescentFeature(const size_t, const arma::mat &iterate, const ResolvableFunctionType &function)
The DescentFeature method is used to get the descent coordinate for the current iteration.