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::GPModels::AEP::SDGPR< Scalar > Class Template Reference

Deep sparse Gaussian process via Approximated Expectation Propagation (AEP). More...

`#include <FgAEPSparseDGPR.h>`

Inheritance diagram for NeuralEngine::MachineLearning::GPModels::AEP::SDGPR< Scalar >:
[legend]
Collaboration diagram for NeuralEngine::MachineLearning::GPModels::AEP::SDGPR< Scalar >:
[legend]

## Public Member Functions
| SDGPR (const af::array &Y, const af::array &X, HiddenLayerDescription hiddenLayerdescription, Scalar alpha=1.0, LogLikType lType=LogLikType::Gaussian)
| Constructor. More...
| SDGPR (const af::array &Y, const af::array &X, std::vector< HiddenLayerDescription > hiddenLayerdescriptions, Scalar alpha=1.0, LogLikType lType=LogLikType::Gaussian)
| Constructor. More...
| SDGPR ()
| Default constructor. More...
virtual Scalar | Function (const af::array &x, af::array &outGradient) override
| Cost function the given x inputs. More...
Public Member Functions inherited from NeuralEngine::MachineLearning::GPModels::SparseDeepGPBaseModel< Scalar >
| SparseDeepGPBaseModel (const af::array &Y, const af::array &X, HiddenLayerDescription hiddenLayerdescription, LogLikType lType=LogLikType::Gaussian)
| Constructor. More...
| SparseDeepGPBaseModel (const af::array &Y, const af::array &X, std::vector< HiddenLayerDescription > hiddenLayerdescriptions, LogLikType lType=LogLikType::Gaussian)
| Constructor. More...
| SparseDeepGPBaseModel ()
| Default Constructor. More...
virtual | ~SparseDeepGPBaseModel ()
| Destructor. More...
virtual bool | Init () override
| Initializes the model. More...
af::array | GetTrainingInputs ()
| Gets training inputs. More...
virtual void | FixInducing (bool isfixed)
| Set fixation for inducing inputs. More...
Public Member Functions inherited from NeuralEngine::MachineLearning::GPModels::DeepGPBaseModel< Scalar >
| DeepGPBaseModel (const af::array &Y, HiddenLayerDescription hiddenLayerdescription, LogLikType lType=LogLikType::Gaussian)
| Constructor. More...
| DeepGPBaseModel (const af::array &Y, std::vector< HiddenLayerDescription > descriptions, LogLikType lType=LogLikType::Gaussian)
| Constructor. More...
| DeepGPBaseModel ()
| Default Constructor. More...
virtual | ~DeepGPBaseModel ()
| Destructor. More...
virtual void | PredictF (const af::array &testInputs, af::array &mf, af::array &vf) override
| Predict noise free functions values \(\mathbf{F}_*\). More...
virtual void | SampleY (const af::array inputs, int numSamples, af::array &outFunctions) override
| Generate function samples from posterior. More...
virtual int | GetNumParameters () override
| Gets number of parameters. More...
virtual int | GetNumLayers ()
| Gets number of GP layers. More...
virtual void | SetParameters (const af::array &param) override
| Sets the parameters for each optimization iteration. More...
virtual af::array | GetParameters () override
| Gets the parameters for each optimization iteration. More...
virtual void | UpdateParameters () override
| Updates the parameters. More...
virtual std::vector< GPBaseLayer< Scalar > * > | GetGPLayers ()
| Gets vector of GP layers. More...
virtual void | FixKernelParameters (bool isfixed)
| Sets fixation for hyperparameters. More...
Public Member Functions inherited from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >
| GPBaseModel (const af::array &Y, LogLikType lType=LogLikType::Gaussian, ModelType mtype=ModelType::GPR)
| Constructor. More...
| GPBaseModel ()
| Default Constructor. More...
virtual | ~GPBaseModel ()
| Destructor. More...
virtual void | Optimise (OptimizerType method=L_BFGS, Scalar tol=0.0, bool reinit_hypers=true, int maxiter=1000, int mb_size=0, LineSearchType lsType=MoreThuente, bool disp=true, int *cycle=nullptr)
| Optimizes the model parameters for best fit. More...
virtual bool | Init ()
| Initializes the model. More...
virtual void | PredictF (const af::array &testInputs, af::array &mf, af::array &vf)
| Predict noise free functions values \(\mathbf{F}_*\). More...
virtual void | PredictY (const af::array &testInputs, af::array &my, af::array &vy)
| Prediction of test outputs \(\mathbf{Y}_*\). More...
virtual void | SampleY (const af::array inputs, int numSamples, af::array &outFunctions)
| Generate function samples from posterior. More...
virtual void | AddData (const af::array Ytrain)
| Adds training data to the model. More...
af::array | GetTrainingData ()
| Gets the training data set Y. More...
void | SetTrainingData (af::array &data)
| Sets training data Y. More...
virtual int | GetNumParameters ()
| Gets number of parameters. More...
virtual void | SetParameters (const af::array &param)
| Sets the parameters for each optimization iteration. More...
virtual af::array | GetParameters ()
| Gets the parameters for each optimization iteration. More...
virtual void | UpdateParameters ()
| Updates the parameters. More...
virtual void | FixLikelihoodParameters (bool isfixed)
| Sets the likelihood parameters to be fixed or not for optimization. More...
void | SetSegments (af::array segments)
| Sets fixation for hyperparameters. More...
af::array | GetSegments ()
| Gets the start index array for the sequences. More...
Public Member Functions inherited from NeuralEngine::MachineLearning::IModel< Scalar >
virtual Scalar | Function (const af::array &x, af::array &outGradient)
| Cost function the given x inputs. More...
virtual int | GetNumParameters ()=0
| Gets number of parameters to be optimized. More...
virtual void | SetParameters (const af::array &param)=0
| Sets the parameters for each optimization iteration. More...
virtual af::array | GetParameters ()=0
| Gets the parameters for each optimization iteration. More...
virtual void | UpdateParameters ()=0
| Updates the parameters. More...
int | GetDataLenght ()
| Gets data lenght. More...
int | GetDataDimensionality ()
| Gets data dimensionality. More...
ModelType | GetModelType ()
| Gets model type. More...
virtual void | SetBatchSize (int size)
| Sets batch size. More...
int | GetBatchSize ()
| Gets batch size. More...
void | SetIndexes (af::array &indexes)
| Sets the batch indexes. More...

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

## Private Attributes
Scalar | dAlpha

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

## Additional Inherited Members
Protected Member Functions inherited from NeuralEngine::MachineLearning::IModel< Scalar >
| IModel (int numData, int numDimension, ModelType type)
| Constructor. More...
Protected Attributes inherited from NeuralEngine::MachineLearning::GPModels::SparseDeepGPBaseModel< Scalar >
int | iq
af::array | afX
Protected Attributes inherited from NeuralEngine::MachineLearning::GPModels::DeepGPBaseModel< Scalar >
int | iNumLayer
std::vector< int > | vNumPseudosPerLayer
std::vector< int > | vSize
std::vector< GPBaseLayer< Scalar > * > | gpLayer
Protected Attributes inherited from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >
bool | bInit
| check if model is initialized More...
af::array | afY
| training dataset, mean substracted More...
af::array | afBias
| the bias More...
af::array | afSegments
| Index of starting positions for all trials. More...
LikelihoodBaseLayer< Scalar > * | likLayer
| liklihood layer More...
Protected Attributes inherited from NeuralEngine::MachineLearning::IModel< Scalar >
ModelType | mType
int | iN
| dataset length More...
int | iD
| dataset dimension More...
int | iBatchSize
| size of the batch More...
af::array | afIndexes
| indexes of /f$\mathbf{X}/f$ for batch learning More...
af::dtype | m_dType
| floating point precision flag for af::array More...

## Detailed Description

template<typename Scalar>
class NeuralEngine::MachineLearning::GPModels::AEP::SDGPR< Scalar >

Deep sparse Gaussian process via Approximated Expectation Propagation (AEP).

Instead of taking one Gaussian portion out to form the cavity, we take out a fraction defined by the parameter \(\alpha\), which can also be seen as a ratio parameter between VFE and PowerEp with FITC approximation. This is the extension of AEP::SGPR by applying more sparse GP layers for deep architectures.

References:

- Bui, Thang D. and Yan, Josiah and Turner, Richard E. (2016). "A Unifying Framework for Sparse Gaussian Process Approximation using Power Expectation Propagation". ePrint: 1605.07066

, 03.07.2019.

Definition at line 50 of file FgAEPSparseDGPR.h.

## Constructor & Destructor Documentation

## ◆ SDGPR() [1/3]

template<typename Scalar >

NeuralEngine::MachineLearning::GPModels::AEP::SDGPR< Scalar >::SDGPR | ( | const af::array & | Y,
|  | const af::array & | X,
|  | HiddenLayerDescription | hiddenLayerdescription,
|  | Scalar | alpha = `1.0`,
|  | LogLikType | lType = `LogLikType::Gaussian`
| ) |  |

Constructor.

, 12.06.2018.

Parameters

  Y | The training data.
  X | The training inputs.
  hiddenLayerdescription | The description for one hidden layer.
  alpha | (Optional) The alpha.
  lType | (Optional) likelihood type.

## ◆ SDGPR() [2/3]

template<typename Scalar >

NeuralEngine::MachineLearning::GPModels::AEP::SDGPR< Scalar >::SDGPR | ( | const af::array & | Y,
|  | const af::array & | X,
|  | std::vector< HiddenLayerDescription > | hiddenLayerdescriptions,
|  | Scalar | alpha = `1.0`,
|  | LogLikType | lType = `LogLikType::Gaussian`
| ) |  |

Constructor.

, 12.06.2018.

Parameters

  numLayers | (Optional) number gp of layers.

Parameters

  Y | The training data.
  X | The training inputs.
  hiddenLayerdescriptions | The hidden layer descriptions.
  alpha | (Optional) The alpha.
  lType | (Optional) likelihood type.

## ◆ SDGPR() [3/3]

template<typename Scalar >

NeuralEngine::MachineLearning::GPModels::AEP::SDGPR< Scalar >::SDGPR | ( |  | ) |

Default constructor.

Hmetal T, 08/03/2020.

## Member Function Documentation

## ◆ Function()

template<typename Scalar >

virtual Scalar NeuralEngine::MachineLearning::GPModels::AEP::SDGPR< Scalar >::Function | ( | const af::array & | x,
|  | af::array & | outGradient
| ) |  |
| override virtual

Cost function the given x inputs.

Hmetal T, 29.11.2017.

Parameters

  x | The parameters to be optimized.
  outGradient | [in,out] The out gradient.

Returns
  A Scalar.

Reimplemented from NeuralEngine::MachineLearning::IModel< Scalar >.

## ◆ serialize()

template<typename Scalar >
template<class Archive >

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

Definition at line 112 of file FgAEPSparseDGPR.h.

## Friends And Related Function Documentation

## ◆ boost::serialization::access

template<typename Scalar >

friend class boost::serialization::access
| friend

Definition at line 109 of file FgAEPSparseDGPR.h.

## Member Data Documentation

## ◆ dAlpha

template<typename Scalar >

Scalar NeuralEngine::MachineLearning::GPModels::AEP::SDGPR< Scalar >::dAlpha
| private

Definition at line 107 of file FgAEPSparseDGPR.h.

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

- FgAEPSparseDGPR.h