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,
43 template<
typename FunctionType,
bool HasDecomposableEvaluateWithGradient>
51 const size_t batchSize)
53 return static_cast<FunctionType*
>(
63 template<
typename FunctionType>
77 const size_t batchSize)
81 coordinates, begin, gradient, batchSize);
90 template<
typename FunctionType,
91 bool HasDecomposableEvaluateWithGradient =
92 traits::HasEvaluateWithGradient<FunctionType,
94 bool HasDecomposableEvaluate =
95 traits::HasEvaluate<FunctionType,
108 template<
typename FunctionType,
bool HasDecomposableEvaluateWithGradient>
110 HasDecomposableEvaluateWithGradient, true>
116 const size_t batchSize)
const 118 return static_cast<const FunctionType*
>(
128 template<
typename FunctionType>
142 const size_t batchSize)
const 147 coordinates, begin, gradient, batchSize);
156 template<
typename FunctionType,
157 bool HasDecomposableEvaluateWithGradient =
158 traits::HasEvaluateWithGradient<FunctionType,
160 bool HasDecomposableEvaluate =
161 traits::HasEvaluate<FunctionType,
173 template<
typename FunctionType,
bool HasDecomposableEvaluateWithGradient>
175 HasDecomposableEvaluateWithGradient, true>
179 static double Evaluate(
const arma::mat& coordinates,
181 const size_t batchSize)
183 return FunctionType::Evaluate(coordinates, begin, batchSize);
191 template<
typename FunctionType>
203 static double Evaluate(
const arma::mat& coordinates,
205 const size_t batchSize)
208 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.
static double Evaluate(const arma::mat &coordinates, const size_t begin, const size_t batchSize)
double Evaluate(const arma::mat &coordinates, const size_t begin, const size_t batchSize)
This is a utility type used to provide unusable overloads from each of the mixin classes.
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 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...
double Evaluate(const arma::mat &coordinates, const size_t begin, const size_t batchSize) const