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

Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
NeuralEngine::MachineLearning::WhiteKernel< Scalar > Class Template Reference

White kernel function. More...

`#include <FgWhiteKernel.h>`

Inheritance diagram for NeuralEngine::MachineLearning::WhiteKernel< Scalar >:
[legend]
Collaboration diagram for NeuralEngine::MachineLearning::WhiteKernel< Scalar >:
[legend]

## Public Member Functions
| WhiteKernel ()
| Default constructor. More...
| ~WhiteKernel ()
| Destructor. More...
void | ComputeKernelMatrix (const af::array &inX1, const af::array &inX2, af::array &outMatrix)
| Computes the kernel matrix of the kernel. More...
void | ComputeDiagonal (const af::array &inX, af::array &outDiagonal)
| Calculates only diagonal elements of K. More...
void | LogLikGradientX (const af::array &inX, const af::array &indL_dK, af::array &outdL_dX)
| Computes dL/dX for full fit GP. More...
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. More...
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. More...
void | GradX (const af::array &inX1, const af::array &inX2, int q, af::array &outdK_dX)
| Computes dK/dX. More...
void | DiagGradX (const af::array &inX, af::array &outDiagdK_dX)
| Derivative of diagonal elemts of K w.r.t X. More...
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. More...
void | SetParameters (const af::array &param)
| Sets the parameters. More...
af::array | GetParameters ()
| Gets the parameters. More...
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.
Public Member Functions inherited from NeuralEngine::MachineLearning::IKernel< Scalar >
| IKernel (KernelType type, int numParameters)
| Constructor. More...
virtual | ~IKernel ()
| Destructor. More...
virtual int | GetNumParameter ()
| Gets number of parametes of the kernel. More...
virtual KernelType | GetKernelType ()
| Gets kernel type. More...
virtual void | ComputeKernelMatrix (const af::array &inX1, const af::array &inX2, af::array &outMatrix)=0
| Computes the kernel matrix of the kernel. More...
virtual void | ComputeDiagonal (const af::array &inX, af::array &outDiagonal)=0
| Calculates only diagonal elements of K. More...
virtual void | LogLikGradientX (const af::array &inX, const af::array &indL_dK, af::array &outdL_dX)=0
| Computes dL/dX for full fit GP. More...
virtual 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)=0
| Computes dL / dX and dL / dXu for sparse approximation GP. More...
virtual void | LogLikGradientX (const af::array &inX1, const af::array &inX2, const af::array &indL_dK, af::array &outdL_dX)
| Computes dL / dX for sparse approximation GP. More...
virtual void | LogLikGradientParam (const af::array &inX1, const af::array &inX2, const af::array &indL_dK, af::array &outdL_dParam)=0
| Computes the gradient of LL w.r.t. the kernel parameters. More...
virtual void | LogLikGradientParam (const af::array &inX1, const af::array &inX2, const af::array &indL_dK, af::array &outdL_dParam, const af::array *dlogZ_dv)
| Computes the gradient of LL w.r.t. the kernel parameters. More...
virtual void | LogLikGradientCompundKfu (const af::array &indL_dKfu, const af::array &inX, const af::array &inXu, af::array *outdL_dParam, af::array *outdL_dXu, const af::array *dlogZ_dv=nullptr, af::array *outdL_dX=nullptr)
virtual void | LogGradientCompoundKuu (const af::array &inXu, const af::array &inCovDiag, af::array *outdL_dParam, af::array *outdL_dXu)
virtual void | GradX (const af::array &inX1, const af::array &inX2, int q, af::array &outdK_dX)=0
| Computes dK/dX. More...
virtual void | DiagGradX (const af::array &inX, af::array &outDiagdK_dX)=0
| Derivative of diagonal elemts of K w.r.t X. More...
virtual void | DiagGradParam (const af::array &inX, const af::array &inCovDiag, af::array &outDiagdK_dParam)=0
| Derivative of diagonal elemts of K w.r.t kernel parameters. More...
virtual void | SetParameters (const af::array &param)=0
| Sets the parameters. More...
virtual void | SetLogParameters (const af::array &param)
| Sets log parameters. More...
virtual af::array | GetParameters ()=0
| Gets the parameters. More...
virtual af::array | GetLogParameters ()
| Gets log parameters. More...
virtual void | InitParameters (Scalar inMedian)
| Initializes the parameters based on the median of the distances of /f$\mathbf{X}/f$. More...
virtual void | ComputePsiStatistics (const af::array &inXu, const af::array &inMu, const af::array &inS, af::array &outPsi0, af::array &outPsi1, af::array &outPsi2)
| PSI statistics. More...
virtual void | PsiDerivatives (const af::array &indL_dPsi0, const af::array &inPsi1, const af::array &indL_dPsi1, const af::array &inPsi2, const af::array &indL_dPsi2, const af::array &inXu, const af::array &inMu, const af::array &inS, af::array &outdL_dParam, af::array &outdL_dXu, af::array &outdL_dMu, af::array &outdL_dS, const af::array *dlogZ_dv=nullptr)
| Psi derivatives. More...

## Private Member Functions
template<class Archive >
void | serialize (Archive &ar, unsigned int version)

## Private Attributes
Scalar | dPrecision

## Friends
class | boost::serialization::access

## Additional Inherited Members
Protected Member Functions inherited from NeuralEngine::MachineLearning::IKernel< Scalar >
| IKernel ()
| Default constructor. More...
Protected Attributes inherited from NeuralEngine::MachineLearning::IKernel< Scalar >
KernelType | eType
int | iNumParam
af::dtype | m_dType
Scalar | sDegree
af::array | afGHx
af::array | afGHw
af::array | afXs
bool | bCacheK

## Detailed Description

template<typename Scalar>
class NeuralEngine::MachineLearning::WhiteKernel< Scalar >

White kernel function.

Kernel function constructed as follows:

\[k(\mathbf{x}, \mathbf{x}') = \beta^{-1} \delta_{\mathbf{x}, \mathbf{x}'}.\]

Kernel added in compound mode to stabilize learning process. Kernel function captures the noise of the data.

Nick Admin, 5/24/2017.

Definition at line 35 of file FgWhiteKernel.h.

## Constructor & Destructor Documentation

## ◆ WhiteKernel()

template<typename Scalar >

NeuralEngine::MachineLearning::WhiteKernel< Scalar >::WhiteKernel | ( |  | ) |

Default constructor.

Nick Admin, 5/24/2017.

## ◆ ~WhiteKernel()

template<typename Scalar >

NeuralEngine::MachineLearning::WhiteKernel< Scalar >::~WhiteKernel | ( |  | ) |

Destructor.

Nick Admin, 5/24/2017.

## Member Function Documentation

## ◆ ComputeKernelMatrix()

template<typename Scalar >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::ComputeKernelMatrix | ( | const af::array & | inX1,
|  | const af::array & | inX2,
|  | af::array & | outMatrix
| ) |  |
| virtual

Computes the kernel matrix of the kernel.

Nick Admin, 5/23/2017.

Parameters

  inX1 | [in,out] First n times q matrix of latent points.
  inX2 | [in,out] Second m times q matrix of latent points (X').
  outMatrix | [in,out] Resulting kernel matrix.< / param>

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ ComputeDiagonal()

template<typename Scalar >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::ComputeDiagonal | ( | const af::array & | inX,
|  | af::array & | outDiagonal
| ) |  |
| virtual

Calculates only diagonal elements of K.

Nick Admin, 5/24/2017.

Parameters

  inX | [in,out] Nxq matrix X.
  outDiagonal | [in,out] The out diagonal.

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ LogLikGradientX() [1/2]

template<typename Scalar >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::LogLikGradientX | ( | const af::array & | inX,
|  | const af::array & | indL_dK,
|  | af::array & | outdL_dX
| ) |  |
| virtual

Computes dL/dX for full fit GP.

Nick Admin, 5/23/2017.

Returns
  The method returns the gradients of the latent points of type ILArray<Scalar>.

Parameters

  inX | [in,out] Nxq Matrix of latent points.
  indL_dK | [in,out] Derivative of the loglikelihood w.r.t kernel matrix K.
  outdL_dX | [in,out] Derivative of the loglikelihood w.r.t latent points.

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ LogLikGradientX() [2/2]

template<typename Scalar >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::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
| ) |  |
| virtual

Computes dL / dX and dL / dXu for sparse approximation GP.

Nick Admin, 5/23/2017.

Parameters

  inXu | [in,out] kxq Matrix of latent subset points.
  indL_dKuu | [in,out] Derivative of the loglikelihood w.r.t subset kernel matrix Kuu.
  inX | [in,out] Nxq Matrix of latent points.
  indL_dKuf | [in,out] Derivative of the loglikelihood w.r.t the kernel matrix K.
  outdL_dXu | [in,out] Derivative of the loglikelihood w.r.t latent subset points Xu.
  outdL_dX | [in,out] Derivative of the loglikelihood w.r.t latent points X.

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ LogLikGradientParam()

template<typename Scalar >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::LogLikGradientParam | ( | const af::array & | inX1,
|  | const af::array & | inX2,
|  | const af::array & | indL_dK,
|  | af::array & | outdL_dParam
| ) |  |
| virtual

Computes the gradient of the kernel parameters.

Nick Admin, 5/23/2017.

Parameters

  indL_dK | [in,out] Derivative of the loglikelihood w.r.t the kernel matrix K.
  outdL_dParam | [in,out] Gradient of kernel parameters.

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ GradX()

template<typename Scalar >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::GradX | ( | const af::array & | inX1,
|  | const af::array & | inX2,
|  | int | q,
|  | af::array & | outdK_dX
| ) |  |
| virtual

Computes dK/dX.

Nick Admin, 5/23/2017.

Parameters

  inX1 | [in,out] First n times q matrix of latent points.
  inX2 | [in,out] Second n times q matrix of latent points (X').
  q | The latent dimension to process.
  outdK_dX | [in,out] dK/dX.

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ DiagGradX()

template<typename Scalar >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::DiagGradX | ( | const af::array & | inX,
|  | af::array & | outDiagdK_dX
| ) |  |
| virtual

Derivative of diagonal elemts of K w.r.t X.

Nick Admin, 5/23/2017.

Parameters

  inX | [in,out] The in x coordinate.
  outDiagdK_dX | [in,out] Derivative of diagonal elemts of K w.r.t X.

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ DiagGradParam()

template<typename Scalar >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::DiagGradParam | ( | const af::array & | inX,
|  | const af::array & | inCovDiag,
|  | af::array & | outDiagdK_dParam
| ) |  |
| virtual

Derivative of diagonal elemts of K w.r.t kernel parameters.

Nick Admin, 5/23/2017.

Parameters

  inX | [in,out] Nxq matrix of Latent points X.
  inCovDiag | [in,out] Diagonal of kernel matrix K.
  outDiagdK_dParam | [in,out] Derivative of diagonal elemts of K w.r.t kernel parameters.

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ SetParameters()

template<typename Scalar >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::SetParameters | ( | const af::array & | param | ) |
| virtual

Sets the parameters.

Nick, 26.06.2018.

Parameters

  param | The parameter.

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ GetParameters()

template<typename Scalar >

af::array NeuralEngine::MachineLearning::WhiteKernel< Scalar >::GetParameters | ( |  | ) |
| virtual

Gets the parameters.

Nick, 26.06.2018.

Returns
  The parameters.

Implements NeuralEngine::MachineLearning::IKernel< Scalar >.

## ◆ serialize()

template<typename Scalar >
template<class Archive >

void NeuralEngine::MachineLearning::WhiteKernel< Scalar >::serialize | ( | Archive & | ar,
|  | unsigned int | version
| ) |  |
| inline private

Definition at line 178 of file FgWhiteKernel.h.

## Friends And Related Function Documentation

## ◆ boost::serialization::access

template<typename Scalar >

friend class boost::serialization::access
| friend

Definition at line 175 of file FgWhiteKernel.h.

## Member Data Documentation

## ◆ dPrecision

template<typename Scalar >

Scalar NeuralEngine::MachineLearning::WhiteKernel< Scalar >::dPrecision
| private

Definition at line 185 of file FgWhiteKernel.h.

The documentation for this class was generated from the following file:

- FgWhiteKernel.h