Base class for optimization methods. More...
#include <BaseOptimizationMethod.h>


Public Member Functions | |
| virtual int | GetNumberOfVariables () |
| Gets the number of variables (free parameters) in the optimization problem. More... | |
| virtual af::array | GetSolution () |
| Gets the current solution found, the values of the parameters which optimizes the function. More... | |
| virtual void | SetSolution (af::array &x) |
| Sets the current solution found, the values of the parameters which optimizes the function. More... | |
| virtual Scalar | GetValue () |
| Gets the output of the function at the current Solution. More... | |
| virtual bool | Maximize (af::array &values, int *cycle=nullptr) |
| Finds the maximum value of a function. The solution vector will be made available at the Solution property. More... | |
| virtual bool | Minimize (af::array &values, int *cycle=nullptr) |
| Finds the minimum value of a function. The solution vector will be made available at the Solution property. More... | |
| virtual bool | Maximize (int *cycle=nullptr) |
| Finds the maximum value of a function. The solution vector will be made available at the Solution property. More... | |
| virtual bool | Minimize (int *cycle=nullptr) |
| Finds the minimum value of a function. The solution vector will be made available at the Solution property. More... | |
| void | Display (bool display) |
| Set to display optimization information. More... | |
| virtual int | GetNumberOfVariables ()=0 |
| Gets the number of variables (free parameters) in the optimization problem. More... | |
| virtual af::array | GetSolution ()=0 |
| Gets the current solution found, the values of the parameters which optimizes the function. More... | |
| virtual void | SetSolution (af::array &x)=0 |
| Gets a solution. More... | |
| virtual Scalar | GetValue ()=0 |
| Gets the output of the function at the current Solution. More... | |
| virtual bool | Minimize (int *cycle=nullptr)=0 |
| Finds the minimum value of a function. The solution vector will be made available at the Solution property. More... | |
| virtual bool | Maximize (int *cycle=nullptr)=0 |
| Finds the maximum value of a function. The solution vector will be made available at the Solution property. More... | |
Protected Member Functions | |
| void | SetValue (Scalar v) |
| Sets the output of the function at the current Solution. More... | |
| void | SetNumberOfVariables (int n) |
| Sets the number of variables (free parameters) in the optimization problem. More... | |
| BaseOptimizationMethod (int numberOfVariables) | |
| Initializes a new instance of the BaseOptimizationMethod class. More... | |
| BaseOptimizationMethod (int numberOfVariables, std::function< Scalar(const af::array &, af::array &)> function) | |
| Initializes a new instance of the BaseOptimizationMethod class. More... | |
| BaseOptimizationMethod (NonlinearObjectiveFunction< Scalar > *function) | |
| Initializes a new instance of the BaseOptimizationMethod class. More... | |
| virtual bool | Optimize (int *cycle=nullptr)=0 |
| Implements the actual optimization algorithm. This method should try to minimize the objective function. More... | |
Protected Attributes | |
| NonlinearObjectiveFunction< Scalar > * | _function |
| af::array | _x |
| bool | _display |
| af::dtype | m_dtype |
Private Member Functions | |
| void | init (int numberOfVariables) |
Private Attributes | |
| Scalar | _value |
| int | _numVariables |
Base class for optimization methods.
Admin, 3/21/2017.
Definition at line 30 of file BaseOptimizationMethod.h.
|
protected |
Initializes a new instance of the BaseOptimizationMethod class.
Hmetal T, 17.03.2017.
| numberOfVariables | The number of free parameters in the optimization problem. |
|
protected |
Initializes a new instance of the BaseOptimizationMethod class.
Hmetal T, 17.03.2017.
| numberOfVariables | The number of free parameters in the optimization problem. |
| function | The objective function whose optimum values should be found. |
|
protected |
Initializes a new instance of the BaseOptimizationMethod class.
Hmetal T, 17.03.2017.
| function | The objective function whose optimum values should be found. |
|
virtual |
Gets the number of variables (free parameters) in the optimization problem.
The number of parameters.
Implements NeuralEngine::MachineLearning::IOptimizationMethod< Scalar >.
|
virtual |
Gets the current solution found, the values of the parameters which optimizes the function.
Hmetal T, 17.03.2017.
Implements NeuralEngine::MachineLearning::IOptimizationMethod< Scalar >.
|
virtual |
Sets the current solution found, the values of the parameters which optimizes the function.
Hmetal T, 17.03.2017.
Implements NeuralEngine::MachineLearning::IOptimizationMethod< Scalar >.
|
virtual |
Gets the output of the function at the current Solution.
Hmetal T, 17.03.2017.
Implements NeuralEngine::MachineLearning::IOptimizationMethod< Scalar >.
|
virtual |
Finds the maximum value of a function. The solution vector will be made available at the Solution property.
Hmetal T, 17.03.2017.
| values | The initial solution vector to start the search. |
true if the method converged to a Solution. In this case, the found value will also be available at the Value property.
|
virtual |
Finds the minimum value of a function. The solution vector will be made available at the Solution property.
Hmetal T, 17.03.2017.
| values | The initial solution vector to start the search. |
true if the method converged to a Solution. In this case, the found value will also be available at the Value property.
|
virtual |
Finds the maximum value of a function. The solution vector will be made available at the Solution property.
Hmetal T, 17.03.2017.
true if the method converged to a Solution. In this case, the found value will also be available at the Value property. Implements NeuralEngine::MachineLearning::IOptimizationMethod< Scalar >.
|
virtual |
Finds the minimum value of a function. The solution vector will be made available at the Solution property.
Hmetal T, 17.03.2017.
true if the method converged to a Solution. In this case, the found value will also be available at the Value property. Implements NeuralEngine::MachineLearning::IOptimizationMethod< Scalar >.
| void NeuralEngine::MachineLearning::BaseOptimizationMethod< Scalar >::Display | ( | bool | display | ) |
Set to display optimization information.
Hmetal T, 03.05.2019.
| display | true to display. |
|
protected |
Sets the output of the function at the current Solution.
Hmetal T, 17.03.2017.
|
protected |
Sets the number of variables (free parameters) in the optimization problem.
The number of parameters.
|
protectedpure virtual |
Implements the actual optimization algorithm. This method should try to minimize the objective function.
Hmetal T, 18.03.2017.
Implemented in NeuralEngine::MachineLearning::AdaMaxSolver< Scalar, LSType >, NeuralEngine::MachineLearning::AdamSolver< Scalar, LSType >, NeuralEngine::MachineLearning::LBFGSBSolver< Scalar, LSType >, NeuralEngine::MachineLearning::LBFGSSolver< Scalar, LSType >, NeuralEngine::MachineLearning::NadamSolver< Scalar, LSType >, and NeuralEngine::MachineLearning::ScaledConjugateGradient< Scalar, LSType >.
|
protected |
Definition at line 231 of file BaseOptimizationMethod.h.
|
protected |
Definition at line 233 of file BaseOptimizationMethod.h.
|
protected |
Definition at line 235 of file BaseOptimizationMethod.h.
|
protected |
Definition at line 237 of file BaseOptimizationMethod.h.
|
private |
Definition at line 243 of file BaseOptimizationMethod.h.
|
private |
Definition at line 244 of file BaseOptimizationMethod.h.