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

FgWhiteKernel.h
1
11#pragma once
12
13#include <NeEngineLib.h>
14#include <MachineLearning/FgIKernel.h>
15
16 namespace NeuralEngine
17{
18 namespace MachineLearning
19 {
34 template<typename Scalar>
35 class NE_IMPEXP WhiteKernel : public IKernel<Scalar>
36 {
37 public:
43 WhiteKernel();
44
50 ~WhiteKernel();
51
61 void ComputeKernelMatrix(const af::array& inX1, const af::array& inX2, af::array& outMatrix);
62
71 void ComputeDiagonal(const af::array& inX, af::array& outDiagonal);
72
88 void LogLikGradientX(const af::array& inX, const af::array& indL_dK, af::array& outdL_dX);
89
102 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);
103
114 void LogLikGradientParam(const af::array& inX1, const af::array& inX2, const af::array& indL_dK, af::array& outdL_dParam);
115
126 void GradX(const af::array& inX1, const af::array& inX2, int q, af::array& outdK_dX);
127
136 void DiagGradX(const af::array& inX, af::array& outDiagdK_dX);
137
147 void DiagGradParam(const af::array& inX, const af::array& inCovDiag, af::array& outDiagdK_dParam);
148
156 void SetParameters(const af::array& param);
157
165 af::array GetParameters();
166
170
171 void Psi1Derivative(const af::array& inPsi1, const af::array& indL_dpsi1, const af::array& inZ, const af::array& inMu,
172 const af::array& inSu, af::array& outdL_dParam, af::array& outdL_dXu, af::array* outdL_dX = nullptr);
173
174 private:
175 friend class boost::serialization::access;
176
177 template<class Archive>
178 void serialize(Archive& ar, unsigned int version)
179 {
180 ar & boost::serialization::base_object<IKernel<Scalar>>(*this);
181 ar& BOOST_SERIALIZATION_NVP(dPrecision);
182 }
183
184 //af::array afParameter; // []{variance, dInvScale}
185 Scalar dPrecision;
186 };
187 }
188}
NeuralEngine::MachineLearning::IKernel
Definition: FgIKernel.h:36
NeuralEngine::MachineLearning::WhiteKernel
White kernel function.
Definition: FgWhiteKernel.h:36
NeuralEngine::MachineLearning::WhiteKernel::ComputeDiagonal
void ComputeDiagonal(const af::array &inX, af::array &outDiagonal)
Calculates only diagonal elements of K.
NeuralEngine::MachineLearning::WhiteKernel::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::WhiteKernel::WhiteKernel
WhiteKernel()
Default constructor.
NeuralEngine::MachineLearning::WhiteKernel::DiagGradX
void DiagGradX(const af::array &inX, af::array &outDiagdK_dX)
Derivative of diagonal elemts of K w.r.t X.
NeuralEngine::MachineLearning::WhiteKernel::SetParameters
void SetParameters(const af::array &param)
Sets the parameters.
NeuralEngine::MachineLearning::WhiteKernel::ComputeKernelMatrix
void ComputeKernelMatrix(const af::array &inX1, const af::array &inX2, af::array &outMatrix)
Computes the kernel matrix of the kernel.
NeuralEngine::MachineLearning::WhiteKernel::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::WhiteKernel::GradX
void GradX(const af::array &inX1, const af::array &inX2, int q, af::array &outdK_dX)
Computes dK/dX.
NeuralEngine::MachineLearning::WhiteKernel::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::WhiteKernel::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::WhiteKernel::GetParameters
af::array GetParameters()
Gets the parameters.
NeuralEngine::MachineLearning::WhiteKernel::~WhiteKernel
~WhiteKernel()
Destructor.
NeuralEngine::MachineLearning::WhiteKernel::LogLikGradientX
void LogLikGradientX(const af::array &inX, const af::array &indL_dK, af::array &outdL_dX)
Computes dL/dX for full fit GP.
Scalar
NeuralEngine
Definition: NeArray2.h:18