15 #ifndef MLPACK_CORE_OPTIMIZERS_STATIC_CHECKS_HPP
16 #define MLPACK_CORE_OPTIMIZERS_STATIC_CHECKS_HPP
22 namespace optimization {
30 template<
typename FunctionType>
34 HasEvaluate<FunctionType, EvaluateForm>::value ||
35 HasEvaluate<FunctionType, EvaluateConstForm>::value ||
36 HasEvaluate<FunctionType, EvaluateStaticForm>::value;
44 template <
typename FunctionType>
48 HasGradient<FunctionType, GradientForm>::value ||
49 HasGradient<FunctionType, GradientConstForm>::value ||
50 HasGradient<FunctionType, GradientStaticForm>::value;
58 template<
typename FunctionType>
62 HasNumFunctions<FunctionType, NumFunctionsForm>::value ||
63 HasNumFunctions<FunctionType, NumFunctionsConstForm>::value ||
64 HasNumFunctions<FunctionType, NumFunctionsStaticForm>::value;
72 template<
typename FunctionType>
76 HasShuffle<FunctionType, ShuffleForm>::value ||
77 HasShuffle<FunctionType, ShuffleConstForm>::value ||
78 HasShuffle<FunctionType, ShuffleStaticForm>::value;
86 template<
typename FunctionType>
90 HasEvaluate<FunctionType, DecomposableEvaluateForm>::value ||
91 HasEvaluate<FunctionType, DecomposableEvaluateConstForm>::value ||
92 HasEvaluate<FunctionType, DecomposableEvaluateStaticForm>::value;
100 template <
typename FunctionType>
104 HasGradient<FunctionType, DecomposableGradientForm>::value ||
105 HasGradient<FunctionType, DecomposableGradientConstForm>::value ||
106 HasGradient<FunctionType, DecomposableGradientStaticForm>::value;
114 template<
typename FunctionType>
118 HasNumConstraints<FunctionType, NumConstraintsForm>::value ||
119 HasNumConstraints<FunctionType, NumConstraintsConstForm>::value ||
120 HasNumConstraints<FunctionType, NumConstraintsStaticForm>::value;
128 template<
typename FunctionType>
132 HasEvaluateConstraint<FunctionType, EvaluateConstraintForm>::value ||
133 HasEvaluateConstraint<FunctionType, EvaluateConstraintConstForm>::value ||
134 HasEvaluateConstraint<FunctionType, EvaluateConstraintStaticForm>::value;
142 template <
typename FunctionType>
146 HasGradientConstraint<FunctionType, GradientConstraintForm>::value ||
147 HasGradientConstraint<FunctionType, GradientConstraintConstForm>::value ||
148 HasGradientConstraint<FunctionType, GradientConstraintStaticForm>::value;
157 template <
typename FunctionType>
161 HasGradient<FunctionType, SparseGradientForm>::value ||
162 HasGradient<FunctionType, SparseGradientConstForm>::value ||
163 HasGradient<FunctionType, SparseGradientStaticForm>::value;
171 template<
typename FunctionType>
175 HasNumFeatures<FunctionType, NumFeaturesForm>::value ||
176 HasNumFeatures<FunctionType, NumFeaturesConstForm>::value ||
177 HasNumFeatures<FunctionType, NumFeaturesStaticForm>::value;
185 template <
typename FunctionType>
189 HasPartialGradient<FunctionType, PartialGradientForm>::value ||
190 HasPartialGradient<FunctionType, PartialGradientConstForm>::value ||
191 HasPartialGradient<FunctionType, PartialGradientStaticForm>::value;
199 template<
typename FunctionType>
203 HasEvaluateWithGradient<FunctionType, EvaluateWithGradientForm>::value ||
204 HasEvaluateWithGradient<FunctionType,
206 HasEvaluateWithGradient<FunctionType,
216 template<
typename FunctionType>
220 HasEvaluateWithGradient<FunctionType,
222 HasEvaluateWithGradient<FunctionType,
224 HasEvaluateWithGradient<FunctionType,
231 template<
typename FunctionType>
235 "The FunctionType does not have a correct definition of Evaluate(). "
236 "Please check that the FunctionType fully satisfies the requirements of "
237 "the FunctionType API; see the optimizer tutorial for details.");
240 "The FunctionType does not have a correct definition of Gradient(). "
241 "Please check that the FunctionType fully satisfies the requirements of "
242 "the FunctionType API; see the optimizer tutorial for details.");
245 "The FunctionType does not have a correct definition of "
246 "EvaluateWithGradient(). Please check that the FunctionType fully "
247 "satisfies the requirements of the FunctionType API; see the optimizer "
248 "tutorial for more details.");
254 template<
typename FunctionType>
258 "The FunctionType does not have a correct definition of a decomposable "
259 "Evaluate() method. Please check that the FunctionType fully satisfies"
260 " the requirements of the DecomposableFunctionType API; see the optimizer"
261 " tutorial for more details.");
264 "The FunctionType does not have a correct definition of a decomposable "
265 "Gradient() method. Please check that the FunctionType fully satisfies"
266 " the requirements of the DecomposableFunctionType API; see the optimizer"
267 " tutorial for more details.");
270 "The FunctionType does not have a correct definition of a decomposable "
271 "EvaluateWithGradient() method. Please check that the FunctionType "
272 "fully satisfies the requirements of the DecomposableFunctionType API; "
273 "see the optimizer tutorial for more details.");
276 "The FunctionType does not have a correct definition of NumFunctions(). "
277 "Please check that the FunctionType fully satisfies the requirements of "
278 "the DecomposableFunctionType API; see the optimizer tutorial for more "
282 "The FunctionType does not have a correct definition of Shuffle(). "
283 "Please check that the FunctionType fully satisfies the requirements of "
284 "the DecomposableFunctionType API; see the optimizer tutorial for more "
291 template<
typename FunctionType>
295 "The FunctionType does not have a correct definition of NumFunctions(). "
296 "Please check that the FunctionType fully satisfies the requirements of "
297 "the SparseFunctionType API; see the optimizer tutorial for more "
301 "The FunctionType does not have a correct definition of Evaluate(). "
302 "Please check that the FunctionType fully satisfies the requirements of "
303 "the SparseFunctionType API; see the optimizer tutorial for more "
307 "The FunctionType does not have a correct definition of a sparse "
308 "Gradient() method. Please check that the FunctionType fully satisfies "
309 "the requirements of the SparseFunctionType API; see the optimizer "
310 "tutorial for more details.");
316 template<
typename FunctionType>
320 "The FunctionType does not have a correct definition of Evaluate(). "
321 "Please check that the FunctionType fully satisfies the requirements of "
322 "the NonDifferentiableFunctionType API; see the optimizer tutorial for "
329 template<
typename FunctionType>
333 "The FunctionType does not have a correct definition of NumFeatures(). "
334 "Please check that the FunctionType fully satisfies the requirements of "
335 "the ResolvableFunctionType API; see the optimizer tutorial for more "
339 "The FunctionType does not have a correct definition of Evaluate(). "
340 "Please check that the FunctionType fully satisfies the requirements of "
341 "the ResolvableFunctionType API; see the optimizer tutorial for more "
345 "The FunctionType does not have a correct definition of a partial "
346 "Gradient() function. Please check that the FunctionType fully satisfies "
347 "the requirements of the ResolvableFunctionType API; see the optimizer "
348 "tutorial for more details.");
354 template<
typename FunctionType>
358 "The FunctionType does not have a correct definition of Evaluate(). "
359 "Please check that the FunctionType fully satisfies the requirements of "
360 "the ConstrainedFunctionType API; see the optimizer tutorial for more "
364 "The FunctionType does not have a correct definition of Gradient(). "
365 "Please check that the FunctionType fully satisfies the requirements of "
366 "the ConstrainedFunctionType API; see the optimizer tutorial for more "
370 "The FunctionType does not have a correct definition of NumConstraints()."
371 " Please check that the FunctionType fully satisfies the requirements of "
372 "the ConstrainedFunctionType API; see the optimizer tutorial for more "
376 "The FunctionType does not have a correct definition of "
377 "EvaluateConstraint(). Please check that the FunctionType fully satisfies"
378 " the ConstrainedFunctionType API; see the optimizer tutorial for more "
382 "The FunctionType does not have a correct definition of "
383 "GradientConstraint(). Please check that the FunctionType fully satisfies"
384 " the ConstrainedFunctionType API; see the optimizer tutorial for more "
392 template<
typename FunctionType>
396 "The FunctionType does not have a correct definition of Evaluate(). "
397 "Please check that the FunctionType fully satisfies the requirements of "
398 "the NonDifferentiableDecomposableFunctionType API; see the optimizer "
399 "tutorial for more details.");
Check if a suitable overload of Shuffle() is available.
double(*)(const arma::mat &, arma::mat &) EvaluateWithGradientStaticForm
This is the form of a static EvaluateWithGradient() method.
Check if a suitable overload of PartialGradient() is available.
Check if a suitable overload of Gradient() that supports sparse gradients is available.
double(FunctionType::*)(const arma::mat &, arma::mat &) const EvaluateWithGradientConstForm
This is the form of a const EvaluateWithGradient() method.
Check if a suitable overload of NumFunctions() is available.
Check if a suitable overload of EvaluateConstraint() is available.
void CheckResolvableFunctionTypeAPI()
Perform checks for the ResolvableFunctionType API.
double(*)(const arma::mat &, const size_t, arma::mat &, const size_t) DecomposableEvaluateWithGradientStaticForm
This is the form of a decomposable static EvaluateWithGradient() method.
double(FunctionType::*)(const arma::mat &, const size_t, arma::mat &, const size_t) const DecomposableEvaluateWithGradientConstForm
This is the form of a decomposable const EvaluateWithGradient() method.
Check if a suitable decomposable overload of Gradient() is available.
void CheckNonDifferentiableFunctionTypeAPI()
Perform checks for the NonDifferentiableFunctionType API.
Check if a suitable overload of Gradient() is available.
Check if a suitable overload of EvaluateWithGradient() is available.
Check if a suitable overload of NumFeatures() is available.
Check if a suitable overload of GradientConstraint() is available.
Check if a suitable decomposable overload of EvaluateWithGradient() is available. ...
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
Check if a suitable overload of NumConstraints() is available.
void CheckDecomposableFunctionTypeAPI()
Perform checks for the DecomposableFunctionType API.
Check if a suitable overload of Evaluate() is available.
void CheckSparseFunctionTypeAPI()
Perform checks for the SparseFunctionType API.
void CheckNonDifferentiableDecomposableFunctionTypeAPI()
Perform checks for the NonDifferentiableDecomposableFunctionType API.
double(FunctionType::*)(const arma::mat &, const size_t, arma::mat &, const size_t) DecomposableEvaluateWithGradientForm
This is the form of a decomposable non-const EvaluateWithGradient() method.
void CheckFunctionTypeAPI()
Perform checks for the regular FunctionType API.
Check if a suitable decomposable overload of Evaluate() is available.
void CheckConstrainedFunctionTypeAPI()
Perform checks for the ConstrainedFunctionType API.