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

FgRBFAccelerationKernel.h
1
11#pragma once
12
13#include <NeEngineLib.h>
14#include <MachineLearning/FgIKernel.h>
15
16 namespace NeuralEngine
17{
18 namespace MachineLearning
19 {
33 template<typename Scalar>
34 class NE_IMPEXP RBFAccelerationKernel : public IKernel<Scalar>
35 {
36 public:
42 RBFAccelerationKernel();
43
49 ~RBFAccelerationKernel();
50
60 void ComputeKernelMatrix(const af::array& inX1, const af::array& inX2, af::array& outMatrix);
61
70 void ComputeDiagonal(const af::array& inX, af::array& outDiagonal);
71
87 void LogLikGradientX(const af::array& inX, const af::array& indL_dK, af::array& outdL_dX);
88
101 void LogLikGradientX(const af::array& inXu, const af::array& indL_dKuu, const af::array& inX, const af::array& indL_dKuf, af::array& outdL_dXu, af::array& outdL_dX);
102
113 void LogLikGradientParam(const af::array& inX1, const af::array& inX2, const af::array& indL_dK, af::array& outdL_dParam);
114
125 void GradX(const af::array& inX1, const af::array& inX2, int q, af::array& outdK_dX);
126
135 void DiagGradX(const af::array& inX, af::array& outDiagdK_dX);
136
146 void DiagGradParam(const af::array& inX, const af::array& inCovDiag, af::array& outDiagdK_dParam);
147
155 void SetParameters(const af::array& param);
156
164 af::array GetParameters();
165
169
170 void Psi1Derivative(const af::array& inPsi1, const af::array& indL_dpsi1, const af::array& inZ, const af::array& inMu,
171 const af::array& inSu, af::array& outdL_dParam, af::array& outdL_dXu, af::array* outdL_dX = nullptr);
172
173 private:
174 friend class boost::serialization::access;
175
176 template<class Archive>
177 void serialize(Archive& ar, unsigned int version)
178 {
179 ar & boost::serialization::base_object<IKernel<Scalar>>(*this);
180 ar& BOOST_SERIALIZATION_NVP(dVariance);
181 ar& BOOST_SERIALIZATION_NVP(dInvScale1);
182 ar& BOOST_SERIALIZATION_NVP(dInvScale2);
183 }
184
185 Scalar dVariance, dInvScale1, dInvScale2;
186 };
187 }
188}
NeuralEngine::MachineLearning::IKernel
Definition: FgIKernel.h:36
NeuralEngine::MachineLearning::RBFAccelerationKernel
Radial basis kernel function for second order state space models.
Definition: FgRBFAccelerationKernel.h:35
NeuralEngine::MachineLearning::RBFAccelerationKernel::LogLikGradientX
void LogLikGradientX(const af::array &inXu, const af::array &indL_dKuu, const af::array &inX, const af::array &indL_dKuf, af::array &outdL_dXu, af::array &outdL_dX)
Computes dL / dX and dL / dXu for sparse approximation GP.
NeuralEngine::MachineLearning::RBFAccelerationKernel::LogLikGradientX
void LogLikGradientX(const af::array &inX, const af::array &indL_dK, af::array &outdL_dX)
Computes dL/dX for full fit GP.
NeuralEngine::MachineLearning::RBFAccelerationKernel::RBFAccelerationKernel
RBFAccelerationKernel()
Default constructor.
NeuralEngine::MachineLearning::RBFAccelerationKernel::Psi1Derivative
void Psi1Derivative(const af::array &inPsi1, const af::array &indL_dpsi1, const af::array &inZ, const af::array &inMu, const af::array &inSu, af::array &outdL_dParam, af::array &outdL_dXu, af::array *outdL_dX=nullptr)
PSI statistics.
NeuralEngine::MachineLearning::RBFAccelerationKernel::ComputeKernelMatrix
void ComputeKernelMatrix(const af::array &inX1, const af::array &inX2, af::array &outMatrix)
Computes the kernel matrix of the kernel.
NeuralEngine::MachineLearning::RBFAccelerationKernel::~RBFAccelerationKernel
~RBFAccelerationKernel()
Destructor.
NeuralEngine::MachineLearning::RBFAccelerationKernel::LogLikGradientParam
void LogLikGradientParam(const af::array &inX1, const af::array &inX2, const af::array &indL_dK, af::array &outdL_dParam)
Computes the gradient of the kernel parameters.
NeuralEngine::MachineLearning::RBFAccelerationKernel::ComputeDiagonal
void ComputeDiagonal(const af::array &inX, af::array &outDiagonal)
Calculates only diagonal elements of K.
NeuralEngine::MachineLearning::RBFAccelerationKernel::DiagGradParam
void DiagGradParam(const af::array &inX, const af::array &inCovDiag, af::array &outDiagdK_dParam)
Derivative of diagonal elemts of K w.r.t kernel parameters.
NeuralEngine::MachineLearning::RBFAccelerationKernel::DiagGradX
void DiagGradX(const af::array &inX, af::array &outDiagdK_dX)
Derivative of diagonal elemts of K w.r.t X.
NeuralEngine::MachineLearning::RBFAccelerationKernel::GetParameters
af::array GetParameters()
Gets the parameters.
NeuralEngine::MachineLearning::RBFAccelerationKernel::SetParameters
void SetParameters(const af::array &param)
Sets the parameters.
NeuralEngine::MachineLearning::RBFAccelerationKernel::GradX
void GradX(const af::array &inX1, const af::array &inX2, int q, af::array &outdK_dX)
Computes dK/dX.
Scalar
NeuralEngine
Definition: NeArray2.h:18