13 #ifndef MLPACK_CORE_OPTIMIZERS_FUNCTION_ADD_DECOMPOSABLE_EVALUATE_HPP 14 #define MLPACK_CORE_OPTIMIZERS_FUNCTION_ADD_DECOMPOSABLE_EVALUATE_HPP 19 namespace optimization {
26 template<
typename FunctionType,
27 bool HasDecomposableEvaluateWithGradient =
28 traits::HasEvaluateWithGradient<FunctionType,
30 bool HasDecomposableEvaluate =
31 traits::HasEvaluate<FunctionType,
33 class AddDecomposableEvaluate
37 double Evaluate(traits::UnconstructableType&,
const size_t);
43 template<
typename FunctionType,
bool HasDecomposableEvaluateWithGradient>
44 class AddDecomposableEvaluate<FunctionType, HasDecomposableEvaluateWithGradient,
49 double Evaluate(
const arma::mat& coordinates,
const size_t index)
51 return static_cast<FunctionType*
>(
61 template<
typename FunctionType>
75 const size_t batchSize)
79 coordinates, begin, gradient, batchSize);
88 template<
typename FunctionType,
89 bool HasDecomposableEvaluateWithGradient =
90 traits::HasEvaluateWithGradient<FunctionType,
92 bool HasDecomposableEvaluate =
93 traits::HasEvaluate<FunctionType,
101 template<
typename FunctionType>
115 const size_t batchSize)
const 120 coordinates, begin, gradient, batchSize);
129 template<
typename FunctionType,
130 bool HasDecomposableEvaluateWithGradient =
131 traits::HasEvaluateWithGradient<FunctionType,
133 bool HasDecomposableEvaluate =
134 traits::HasEvaluate<FunctionType,
142 template<
typename FunctionType>
154 static double Evaluate(
const arma::mat& coordinates,
156 const size_t batchSize)
159 return FunctionType::EvaluateWithGradient(coordinates, begin, gradient,
The AddDecomposableEvaluate mixin class will add a decomposable Evaluate() method if a decomposable E...
The AddDecomposableEvaluateStatic mixin class will add a decomposable static Evaluate() method if a d...
double(FunctionType::*)(const arma::mat &, const size_t, const size_t) const DecomposableEvaluateConstForm
This is the form of a decomposable const Evaluate() method.
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.
double Evaluate(const arma::mat &coordinates, const size_t begin, const size_t batchSize)
Return the objective function for the given coordinates, starting at the given decomposable function ...
double Evaluate(traits::UnconstructableType &, const size_t, const size_t)
static double Evaluate(const arma::mat &coordinates, const size_t begin, const size_t batchSize)
Return the objective function for the given coordinates, starting at the given decomposable function ...
double Evaluate(const arma::mat &coordinates, const size_t index)
double Evaluate(const arma::mat &coordinates, const size_t begin, const size_t batchSize) const
Return the objective function for the given coordinates, starting at the given decomposable function ...
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.
The Function class is a wrapper class for any FunctionType that will add any possible derived methods...
double(*)(const arma::mat &, const size_t, const size_t) DecomposableEvaluateStaticForm
This is the form of a decomposable static Evaluate() method.
double(FunctionType::*)(const arma::mat &, const size_t, const size_t) DecomposableEvaluateForm
This is the form of a decomposable Evaluate() method.
The AddDecomposableEvaluateConst mixin class will add a decomposable const Evaluate() method if a dec...