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
16namespace 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>
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
122 };
123
135 template<typename TCode>
137 {
138 public:
150 virtual TCode GetStatus() = 0;
151 };
152 }
153}
Common interface for function optimization methods.
virtual void SetSolution(af::array &x)=0
Gets a solution.
virtual af::array GetSolution()=0
Gets the current solution found, the values of the parameters which optimizes the function.
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...
virtual Scalar GetValue()=0
Gets the output of the function at the current Solution.
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...
virtual int GetNumberOfVariables()=0
Gets the number of variables (free parameters) in the optimization problem.
Common interface for function optimization methods.
virtual TCode GetStatus()=0
Get the exit code returned in the last call to the IOptimizationMethod.Maximize() or IOptimizationMet...