mlpack  1.0.12
test_function.hpp
Go to the documentation of this file.
1 
14 #ifndef __MLPACK_CORE_OPTIMIZERS_SGD_TEST_FUNCTION_HPP
15 #define __MLPACK_CORE_OPTIMIZERS_SGD_TEST_FUNCTION_HPP
16 
17 #include <mlpack/core.hpp>
18 
19 namespace mlpack {
20 namespace optimization {
21 namespace test {
22 
28 {
29  public:
32 
34  size_t NumFunctions() const { return 3; }
35 
37  arma::mat GetInitialPoint() const { return arma::mat("6; -45.6; 6.2"); }
38 
40  double Evaluate(const arma::mat& coordinates, const size_t i) const;
41 
43  void Gradient(const arma::mat& coordinates,
44  const size_t i,
45  arma::mat& gradient) const;
46 };
47 
48 }; // namespace test
49 }; // namespace optimization
50 }; // namespace mlpack
51 
52 #endif
Very, very simple test function which is the composite of three other functions.
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
double Evaluate(const arma::mat &coordinates, const size_t i) const
Evaluate a function.
SGDTestFunction()
Nothing to do for the constructor.
arma::mat GetInitialPoint() const
Get the starting point.
void Gradient(const arma::mat &coordinates, const size_t i, arma::mat &gradient) const
Evaluate the gradient of a function.
size_t NumFunctions() const
Return 3 (the number of functions).