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

FgSCG.h
1
11#pragma once
12
13#include <MachineLearning/BaseGradientOptimizationMethod.h>
14
15 namespace NeuralEngine
16{
17 namespace MachineLearning
18 {
24 enum ScaledConjugateGradientMethod
25 {
26 /*/// <summary>
29 FletcherReeves = 1,
30
38 PolakRibiere = 2,
39
48 PositivePolakRibiere = 3,*/
49 };
50
56 /*enum ScaledConjugateGradientCode
57 {
59 Success,
60
62 StepSize = 1,
63
65 DescentNotObtained = -2,
66
72 RoundingErrors = 6,
73
77 StepHigh = 5,
78
82 StepLow = 4,
83
87 MaximumEvaluations = 3,
88
92 Precision = 2,
93 };*/
94
108
143 template<typename Scalar, LineSearchType LSType = MoreThuente>
144 class NE_IMPEXP ScaledConjugateGradient : public BaseGradientOptimizationMethod<Scalar, LSType>
145 {
146 public:
147
157 ScaledConjugateGradient(int numberOfVariables);
158
170 ScaledConjugateGradient(int numberOfVariables, std::function<Scalar(const af::array&, af::array&)> function);
171
179 ScaledConjugateGradient(NonlinearObjectiveFunction<Scalar>* function);
180
181 ~ScaledConjugateGradient();
182
183
184
185 protected:
186
197 virtual bool Optimize(int* cycle = nullptr) override;
198
199 private:
200
201 };
202 }
203}
NeuralEngine::MachineLearning::BaseGradientOptimizationMethod
Base class for gradient-based optimization methods.
Definition: BaseGradientOptimizationMethod.h:40
NeuralEngine::MachineLearning::NonlinearObjectiveFunction
Definition: NonlinearObjectiveFunction.h:21
NeuralEngine::MachineLearning::ScaledConjugateGradient
Conjugate Gradient exit codes.
Definition: FgSCG.h:145
NeuralEngine::MachineLearning::ScaledConjugateGradient::ScaledConjugateGradient
ScaledConjugateGradient(int numberOfVariables, std::function< Scalar(const af::array &, af::array &)> function)
Creates a new instance of the CG optimization algorithm.
NeuralEngine::MachineLearning::ScaledConjugateGradient::Optimize
virtual bool Optimize(int *cycle=nullptr) override
Implements the actual optimization algorithm. This method should try to minimize the objective functi...
NeuralEngine::MachineLearning::ScaledConjugateGradient::ScaledConjugateGradient
ScaledConjugateGradient(NonlinearObjectiveFunction< Scalar > *function)
Creates a new instance of the CG optimization algorithm.
NeuralEngine::MachineLearning::ScaledConjugateGradient::ScaledConjugateGradient
ScaledConjugateGradient(int numberOfVariables)
Creates a new instance of the CG optimization algorithm.
Scalar
NeuralEngine
Definition: NeArray2.h:18