12 #ifndef MLPACK_CORE_HPT_CV_FUNCTION_HPP
13 #define MLPACK_CORE_HPT_CV_FUNCTION_HPP
35 template<
typename CVType,
38 typename... BoundArgs>
64 const double relativeDelta,
65 const double minDelta,
66 const BoundArgs&... args);
74 double Evaluate(
const arma::mat& parameters);
84 void Gradient(
const arma::mat& parameters, arma::mat& gradient);
91 using BoundArgsTupleType = std::tuple<BoundArgs...>;
94 static const size_t BoundArgsAmount =
95 std::tuple_size<BoundArgsTupleType>::value;
102 template<
size_t BoundArgIndex,
104 bool BoundArgsIndexInRange = (BoundArgIndex < BoundArgsAmount)>
114 BoundArgsTupleType boundArgs;
117 double bestObjective;
120 MLAlgorithm bestModel;
123 double relativeDelta;
131 template<
size_t BoundArgIndex,
135 std::enable_if<(BoundArgIndex + ParamIndex < TotalArgs)>::type>
136 inline double Evaluate(
const arma::mat& parameters,
const Args&... args);
141 template<
size_t BoundArgIndex,
145 std::enable_if<BoundArgIndex + ParamIndex == TotalArgs>::type,
147 inline double Evaluate(
const arma::mat& parameters,
const Args&... args);
152 template<
size_t BoundArgIndex,
155 typename =
typename std::enable_if<
156 UseBoundArg<BoundArgIndex, ParamIndex>::value>::type>
157 inline double PutNextArg(
const arma::mat& parameters,
const Args&... args);
163 template<
size_t BoundArgIndex,
166 typename =
typename std::enable_if<
167 !UseBoundArg<BoundArgIndex, ParamIndex>::value>::type,
169 inline double PutNextArg(
const arma::mat& parameters,
const Args&... args);
177 #include "cv_function_impl.hpp"