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

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar > Class Template Referenceabstract

Abstract class for different GP likelihood layers. More...

`#include <FgLikelihoodBaseLayer.h>`

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

## Public Member Functions
| LikelihoodBaseLayer (LogLikType type, int numPoints, int outputDim)
| Constructor. More...
virtual Scalar | ComputeLogZ (const af::array &mout, const af::array &vout, const af::array &y, Scalar alpha=1.0, af::array *dlogZ_dm=nullptr, af::array *dlogZ_dv=nullptr, af::array *dlogZ_dm2=nullptr)=0
| Calculates the logZ. More...
virtual void | ComputeLogZGradients (const af::array &mout, const af::array &vout, const af::array &y, af::array *dlogZ_dm=nullptr, af::array *dlogZ_dv=nullptr, af::array *dlogZ_dm2=nullptr, Scalar alpha=1.0)=0
| Calculates logZ gradients. More...
virtual Scalar | BackpropagationGradients (const af::array &mout, const af::array &vout, af::array &dmout, af::array &dvout, Scalar alpha=1.0, Scalar scale=1.0)=0
virtual Scalar | ComputeLogLikExp (const af::array &mout, const af::array &vout, const af::array &y)=0
virtual void | ComputeLogLikExpGradients (const af::array &mout, const af::array &vout, const af::array &y, af::array *de_dm=nullptr, af::array *de_dv=nullptr)=0
virtual Scalar | BackpropagationGradientsLogLikExp (const af::array &mout, const af::array &vout, af::array &dmout, af::array &dvout, af::array &y, Scalar scale=1.0)=0
virtual void | ProbabilisticOutput (const af::array &mf, const af::array &vf, af::array &myOut, af::array &vyOut, Scalar alpha=1.0f)=0
virtual Scalar | InitParameters ()
LogLikType | GetLogLikType ()
| Gets log likelihood type. More...
virtual int | GetNumParameters ()
| Gets number of parameters to be optimized. 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 | FixParameters (bool isfixed)
| Set to fix the parameters or not for optimization. More...
virtual void | UpdateParameters ()
| Updates the parameters. More...
Public Member Functions inherited from NeuralEngine::MachineLearning::ILayer< Scalar >
| ILayer (LayerType type, int numPoints, int outputDim)
| Constructor. More...
virtual | ~ILayer ()=default
| Destructor. More...
LayerType | GetType ()
| Gets the layer type. 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...
virtual void | SetDataSize (int length, int dimension)
| Sets data size. More...

## Protected Member Functions
| LikelihoodBaseLayer ()
| Default constructor. More...
Protected Member Functions inherited from NeuralEngine::MachineLearning::ILayer< Scalar >
| ILayer ()
| Default constructor. More...

## Protected Attributes
bool | isFixedParam
bool | bDimMod
Protected Attributes inherited from NeuralEngine::MachineLearning::ILayer< Scalar >
int | iD
| data dimension More...
int | iN
| data size More...
LayerType | lType
| liklihood or gp layer More...
af::dtype | m_dType
| floating point precision flag for af::array More...

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

## Private Attributes
LogLikType | lltype

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

## Detailed Description

template<typename Scalar>
class NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >

Abstract class for different GP likelihood layers.

, 27.02.2018.

Definition at line 34 of file FgLikelihoodBaseLayer.h.

## Constructor & Destructor Documentation

## ◆ LikelihoodBaseLayer() [1/2]

template<typename Scalar >

NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::LikelihoodBaseLayer | ( | LogLikType | type,
|  | int | numPoints,
|  | int | outputDim
| ) |  |

Constructor.

, 26.04.2018.

Parameters

  type | The likelihood type.
  numPoints | Number of data points.
  outputDim | Dimension of data points.

## ◆ LikelihoodBaseLayer() [2/2]

template<typename Scalar >

NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::LikelihoodBaseLayer | ( |  | ) |
| inline protected

Default constructor.

, 26.06.2018.

Definition at line 151 of file FgLikelihoodBaseLayer.h.

## Member Function Documentation

## ◆ ComputeLogZ()

template<typename Scalar >

virtual Scalar NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::ComputeLogZ | ( | const af::array & | mout,
|  | const af::array & | vout,
|  | const af::array & | y,
|  | Scalar | alpha = `1.0`,
|  | af::array * | dlogZ_dm = `nullptr`,
|  | af::array * | dlogZ_dv = `nullptr`,
|  | af::array * | dlogZ_dm2 = `nullptr`
| ) |  |
| pure virtual

Calculates the logZ.

Hmetal T, 05/05/2018.

Parameters

  mout | [in,out] The mean.
  vout | The standart deviation.
  y | [in,out] Sample data vector.
  alpha | (Optional) Weight between alpha- and KL-divergence.

Returns
  The calculated log z coordinate.

Implemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >, and NeuralEngine::MachineLearning::GPModels::ProbitLikLayer< Scalar >.

## ◆ ComputeLogZGradients()

template<typename Scalar >

virtual void NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::ComputeLogZGradients | ( | const af::array & | mout,
|  | const af::array & | vout,
|  | const af::array & | y,
|  | af::array * | dlogZ_dm = `nullptr`,
|  | af::array * | dlogZ_dv = `nullptr`,
|  | af::array * | dlogZ_dm2 = `nullptr`,
|  | Scalar | alpha = `1.0`
| ) |  |
| pure virtual

Calculates logZ gradients.

Hmetal T, 05/05/2018.

Parameters

  mout | [in,out] The mean.
  vout | [in,out] The standart deviation.
  y | [in,out] Sample data vector.
  dlogZ_dm | [in,out] (Optional) If non-null, derivative of logZ w.r.t mean.
  dlogZ_dv | [in,out] (Optional) If non-null, derivative of logZ w.r.t standart deviation.
  dlogZ_dm2 | [in,out] (Optional) If non-null, derivative of logZ w.r.t mean^2.

Implemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >, and NeuralEngine::MachineLearning::GPModels::ProbitLikLayer< Scalar >.

## ◆ InitParameters()

template<typename Scalar >

virtual Scalar NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::InitParameters | ( |  | ) |
| inline virtual

Definition at line 91 of file FgLikelihoodBaseLayer.h.

## ◆ GetLogLikType()

template<typename Scalar >

LogLikType NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::GetLogLikType | ( |  | ) |

Gets log likelihood type.

, 26.04.2018.

Returns
  The log likelihood type.

## ◆ GetNumParameters()

template<typename Scalar >

virtual int NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::GetNumParameters | ( |  | ) |
| virtual

Gets number of parameters to be optimized.

, 26.06.2018.

Returns
  The number parameters.

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

Reimplemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >.

## ◆ SetParameters()

template<typename Scalar >

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

Sets the parameters for each optimization iteration.

, 26.06.2018.

Parameters

  param | The parameter.

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

Reimplemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >.

## ◆ GetParameters()

template<typename Scalar >

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

Gets the parameters for each optimization iteration.

, 26.06.2018.

Returns
  The parameters.

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

Reimplemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >.

## ◆ FixParameters()

template<typename Scalar >

virtual void NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::FixParameters | ( | bool | isfixed | ) |
| virtual

Set to fix the parameters or not for optimization.

Hmetal T, 17/12/2019.

Parameters

  isfixed | True if is fixed.

## ◆ UpdateParameters()

template<typename Scalar >

virtual void NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::UpdateParameters | ( |  | ) |
| inline virtual

Updates the parameters.

, 26.06.2018.

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

Reimplemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >.

Definition at line 143 of file FgLikelihoodBaseLayer.h.

## ◆ serialize()

template<typename Scalar >
template<class Archive >

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

Definition at line 162 of file FgLikelihoodBaseLayer.h.

## Friends And Related Function Documentation

## ◆ boost::serialization::access

template<typename Scalar >

friend class boost::serialization::access
| friend

Definition at line 159 of file FgLikelihoodBaseLayer.h.

## Member Data Documentation

## ◆ isFixedParam

template<typename Scalar >

bool NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::isFixedParam
| protected

Definition at line 153 of file FgLikelihoodBaseLayer.h.

## ◆ bDimMod

template<typename Scalar >

bool NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::bDimMod
| protected

Definition at line 154 of file FgLikelihoodBaseLayer.h.

## ◆ lltype

template<typename Scalar >

LogLikType NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::lltype
| private

Definition at line 157 of file FgLikelihoodBaseLayer.h.

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

- FgLikelihoodBaseLayer.h