NeuralEngine A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes. |

IOptimizationMethod.h
1
11#pragma once
12
13#include <NeMachineLearningLib.h>
14#include <MachineLearning/CommonUtil.h>
15
16 namespace NeuralEngine
17{
18 namespace MachineLearning
19 {
20 enum OptimizerType
21 {
22 SCG,
23 L_BFGS_B,
24 L_BFGS,
25 ADAM,
26 ADAMAX,
27 NADAM
28 };
29
41 template<typename Scalar>
42 class IOptimizationMethod
43 {
44
45 public:
46
57 virtual int GetNumberOfVariables() = 0;
58
69 virtual af::array GetSolution() = 0;
70
78 virtual void SetSolution(af::array& x) = 0;
79
87 virtual Scalar GetValue() = 0;
88
103 virtual bool Minimize(int* cycle = nullptr) = 0;
104
119 virtual bool Maximize(int* cycle = nullptr) = 0;
120
121 ~IOptimizationMethod() {};
122 };
123
135 template<typename TCode>
136 class OptimizationMethod
137 {
138 public:
150 virtual TCode GetStatus() = 0;
151 };
152 }
153}
NeuralEngine::MachineLearning::IOptimizationMethod
Common interface for function optimization methods.
Definition: IOptimizationMethod.h:43
NeuralEngine::MachineLearning::IOptimizationMethod::SetSolution
virtual void SetSolution(af::array &x)=0
Gets a solution.
NeuralEngine::MachineLearning::IOptimizationMethod::GetSolution
virtual af::array GetSolution()=0
Gets the current solution found, the values of the parameters which optimizes the function.
NeuralEngine::MachineLearning::IOptimizationMethod::Minimize
virtual bool Minimize(int *cycle=nullptr)=0
Finds the minimum value of a function. The solution vector will be made available at the Solution pro...
NeuralEngine::MachineLearning::IOptimizationMethod::GetValue
virtual Scalar GetValue()=0
Gets the output of the function at the current Solution.
NeuralEngine::MachineLearning::IOptimizationMethod::Maximize
virtual bool Maximize(int *cycle=nullptr)=0
Finds the maximum value of a function. The solution vector will be made available at the Solution pro...
NeuralEngine::MachineLearning::IOptimizationMethod::GetNumberOfVariables
virtual int GetNumberOfVariables()=0
Gets the number of variables (free parameters) in the optimization problem.
NeuralEngine::MachineLearning::OptimizationMethod
Common interface for function optimization methods.
Definition: IOptimizationMethod.h:137
NeuralEngine::MachineLearning::OptimizationMethod::GetStatus
virtual TCode GetStatus()=0
Get the exit code returned in the last call to the IOptimizationMethod.Maximize() or IOptimizationMet...
Scalar
NeuralEngine
Definition: NeArray2.h:18