15 #ifndef MLPACK_CORE_OPTIMIZERS_BIGBATCH_SGD_BACKTRACKING_LINE_SEARCH_HPP 16 #define MLPACK_CORE_OPTIMIZERS_BIGBATCH_SGD_BACKTRACKING_LINE_SEARCH_HPP 19 namespace optimization {
52 searchParameter(searchParameter)
70 template<
typename DecomposableFunctionType>
71 void Update(DecomposableFunctionType&
function,
74 const arma::mat& gradient,
75 const double gradientNorm,
79 const size_t backtrackingBatchSize,
85 double overallObjective =
function.Evaluate(iterate, offset,
86 backtrackingBatchSize);
88 arma::mat iterateUpdate = iterate - (stepSize * gradient);
89 double overallObjectiveUpdate =
function.Evaluate(iterateUpdate,
90 offset, backtrackingBatchSize);
92 while (overallObjectiveUpdate >
93 (overallObjective + searchParameter * stepSize * gradientNorm))
97 iterateUpdate = iterate - (stepSize * gradient);
98 overallObjectiveUpdate =
function.Evaluate(iterateUpdate,
99 offset, backtrackingBatchSize);
105 double searchParameter;
111 #endif // MLPACK_CORE_OPTIMIZERS_BIGBATCH_SGD_BACKTRACKING_LINE_SEARCH_HPP
void Update(DecomposableFunctionType &function, double &stepSize, arma::mat &iterate, const arma::mat &gradient, const double gradientNorm, const double, const size_t offset, const size_t, const size_t backtrackingBatchSize, const bool reset)
This function is called in each iteration.
Definition of the backtracking line search algorithm based on the Armijo–Goldstein condition to dete...
BacktrackingLineSearch(const double searchParameter=0.1)
Construct the BacktrackingLineSearch object with the given function and parameters.