NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
FgKernelBasedRegression.h
1
11#pragma once
12
13#include <MachineLearning/FgIBackconstraint.h>
14#include <MachineLearning/FgKernels.h>
15
16namespace NeuralEngine
17{
18 namespace MachineLearning
19 {
20 namespace GPModels
21 {
66 template<typename Scalar>
67 class NE_IMPEXP KBR : public IBackconstraint<Scalar>
68 {
69 public:
70
76 KBR();
77
83 virtual ~KBR();
84
93 virtual void Init(const af::array& Y, const af::array& X, const af::array& segments);
94
102 virtual int GetNumParameters();
103
111 virtual void SetParameters(const af::array& param);
112
120 virtual af::array GetParameters();
121
129 virtual af::array GetConstraintX();
130
140 virtual af::array BackconstraintGradient(const af::array& gX);
141
149 virtual void SetKernel(IKernel<Scalar>* inKernel);
150
159
160 protected:
161
162 af::array afA;
163 af::array afK;
165
166 private:
167 friend class boost::serialization::access;
168
169 template<class Archive>
170 void serialize(Archive& ar, unsigned int version)
171 {
172 ar& boost::serialization::base_object<IBackconstraint<Scalar>>(*this);
173
174 ar& BOOST_SERIALIZATION_NVP(afA);
175 ar& BOOST_SERIALIZATION_NVP(afK);
176 ar& BOOST_SERIALIZATION_NVP(kernel);
177 }
178 };
179 }
180 }
181}
Abstract class for back-constraints, a kind of prior knowledge to force topological positions of unce...
Back-constraints via kernel based regression.
virtual void SetParameters(const af::array &param)
Sets the parameters.
virtual af::array GetParameters()
Gets the parameters.
virtual int GetNumParameters()
Gets number of to be optimized parameters.
virtual void Init(const af::array &Y, const af::array &X, const af::array &segments)
Initializes this object.
virtual IKernel< Scalar > * GetKernel()
Gets the kernel function.
virtual af::array GetConstraintX()
Gets constraint x coordinates.
virtual af::array BackconstraintGradient(const af::array &gX)
Back-constraint gradient.
virtual void SetKernel(IKernel< Scalar > *inKernel)
Sets a kernel function.