|
| double | EvaluateWithGradient (traits::UnconstructableType &, const size_t, const size_t) const |
| |
| double | EvaluateWithGradient (traits::UnconstructableType &, const size_t, const size_t) |
| |
| void | Gradient (traits::UnconstructableType &, const size_t, const size_t) const |
| |
| void | Gradient (traits::UnconstructableType &, const size_t, const size_t) |
| |
| double | Evaluate (traits::UnconstructableType &, const size_t) const |
| |
| double | Evaluate (traits::UnconstructableType &, const size_t, const size_t) const |
| |
| double | Evaluate (traits::UnconstructableType &, const size_t, const size_t) |
| |
| double | Evaluate (traits::UnconstructableType &, const size_t) |
| |
| double | EvaluateWithGradient (traits::UnconstructableType &) const |
| |
| double | EvaluateWithGradient (traits::UnconstructableType &) |
| |
| void | Gradient (traits::UnconstructableType &) const |
| |
| void | Gradient (traits::UnconstructableType &) |
| |
| double | Evaluate (traits::UnconstructableType &) const |
| |
| double | Evaluate (traits::UnconstructableType &) |
| |
| static double | EvaluateWithGradient (traits::UnconstructableType &, const size_t, const size_t) |
| |
| static void | Gradient (traits::UnconstructableType &, const size_t, const size_t) |
| |
| static double | EvaluateWithGradient (traits::UnconstructableType &) |
| |
| static void | Gradient (traits::UnconstructableType &) |
| |
| static double | Evaluate (traits::UnconstructableType &) |
| |
class mlpack::optimization::Function< FunctionType >
The Function class is a wrapper class for any FunctionType that will add any possible derived methods.
For instance, if the given FunctionType has Evaluate() and Gradient(), then Function<FunctionType> will have EvaluateWithGradient(). This infrastructure allows two things:
- Optimizers can expect FunctionTypes to have a wider array of functions than those FunctionTypes may actually implement.
- FunctionTypes don't need to implement every single method that an optimizer might require, just those from which every method can be inferred.
This class works by inheriting from a large set of "mixin" classes that provide missing functions, if needed. For instance, the AddGradient<> mixin will provide a Gradient() method if the given FunctionType implements an EvaluateWithGradient() method.
Since all of the casting is static and each of the mixin classes is an empty class, there should be no runtime overhead at all for this functionality. In addition, this class does not (to the best of my knowledge) rely on any undefined behavior.
Definition at line 22 of file function.hpp.