12 #ifndef MLPACK_CORE_OPTIMIZERS_CMAES_FULL_SELECTION_HPP 13 #define MLPACK_CORE_OPTIMIZERS_CMAES_FULL_SELECTION_HPP 18 namespace optimization {
34 template<
typename DecomposableFunctionType>
35 double Select(DecomposableFunctionType&
function,
36 const size_t batchSize,
37 const arma::mat& iterate)
40 const size_t numFunctions =
function.NumFunctions();
43 for (
size_t f = 0; f < numFunctions; f += batchSize)
45 const size_t effectiveBatchSize = std::min(batchSize, numFunctions - f);
46 objective +=
function.Evaluate(iterate, f, effectiveBatchSize);
The core includes that mlpack expects; standard C++ includes and Armadillo.
double Select(DecomposableFunctionType &function, const size_t batchSize, const arma::mat &iterate)
Select the full dataset to calculate the objective function.