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

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

Base class with abstract and basic function definitions. All models will be derived from this class.
More...

`#include <FgIModel.h>`

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

## Public Member Functions
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...

## Protected Member Functions
| IModel (int numData, int numDimension, ModelType type)
| Constructor. More...

## Protected Attributes
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...

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

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

## Detailed Description

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

Base class with abstract and basic function definitions. All models will be derived from this class.

HmetalT, 26.10.2017.

Definition at line 102 of file FgIModel.h.

## Constructor & Destructor Documentation

## ◆ IModel()

template<typename Scalar >

NeuralEngine::MachineLearning::IModel< Scalar >::IModel | ( | int | numData,
|  | int | numDimension,
|  | ModelType | type
| ) |  |
| protected

Constructor.

Hmetal T, 16/04/2019.

Parameters

  numData | Number of data samples.
  numDimension | Number of data dimensions.

## Member Function Documentation

## ◆ Function()

template<typename Scalar >

virtual Scalar NeuralEngine::MachineLearning::IModel< Scalar >::Function | ( | const af::array & | x,
|  | af::array & | outGradient
| ) |  |
| virtual

Cost function the given x inputs.

Hmetal T, 29.11.2017.

Parameters

  x | The parameter input.
  outGradient | [in,out] The gradient.

Returns
  A Scalar.

Reimplemented in NeuralEngine::MachineLearning::GPModels::AEP::SDGPLVM< Scalar >, NeuralEngine::MachineLearning::GPModels::AEP::SDGPR< Scalar >, NeuralEngine::MachineLearning::GPModels::AEP::SDGPSSM< Scalar >, NeuralEngine::MachineLearning::GPModels::AEP::SGPLVM< Scalar >, NeuralEngine::MachineLearning::GPModels::AEP::SGPR< Scalar >, and NeuralEngine::MachineLearning::GPModels::AEP::SGPSSM< Scalar >.

## ◆ GetNumParameters()

template<typename Scalar >

virtual int NeuralEngine::MachineLearning::IModel< Scalar >::GetNumParameters | ( |  | ) |
| pure virtual

Gets number of parameters to be optimized.

, 26.06.2018.

Returns
  The number parameters.

Implemented in NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::DeepGPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::GPLVMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::GPSSBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseDeepGPLVMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseDeepGPSSMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseGPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseGPLVMBaseModel< Scalar >, and NeuralEngine::MachineLearning::GPModels::SparseGPSSMBaseModel< Scalar >.

## ◆ SetParameters()

template<typename Scalar >

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

Sets the parameters for each optimization iteration.

, 26.06.2018.

Parameters

  param | The parameter.

Implemented in NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::DeepGPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::GPLVMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::GPSSBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseDeepGPLVMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseDeepGPSSMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseGPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseGPLVMBaseModel< Scalar >, and NeuralEngine::MachineLearning::GPModels::SparseGPSSMBaseModel< Scalar >.

## ◆ GetParameters()

template<typename Scalar >

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

Gets the parameters for each optimization iteration.

, 26.06.2018.

Parameters

  param | The parameter.

Implemented in NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::DeepGPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::GPLVMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::GPSSBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseDeepGPLVMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseDeepGPSSMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseGPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseGPLVMBaseModel< Scalar >, and NeuralEngine::MachineLearning::GPModels::SparseGPSSMBaseModel< Scalar >.

## ◆ UpdateParameters()

template<typename Scalar >

virtual void NeuralEngine::MachineLearning::IModel< Scalar >::UpdateParameters | ( |  | ) |
| pure virtual

Updates the parameters.

, 26.06.2018.

Implemented in NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::DeepGPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::GPLVMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseDeepGPLVMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseDeepGPSSMBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseGPBaseModel< Scalar >, NeuralEngine::MachineLearning::GPModels::SparseGPLVMBaseModel< Scalar >, and NeuralEngine::MachineLearning::GPModels::SparseGPSSMBaseModel< Scalar >.

## ◆ GetDataLenght()

template<typename Scalar >

int NeuralEngine::MachineLearning::IModel< Scalar >::GetDataLenght | ( |  | ) |

Gets data lenght.

Hmetal T, 16/04/2019.

Returns
  The data lenght.

## ◆ GetDataDimensionality()

template<typename Scalar >

int NeuralEngine::MachineLearning::IModel< Scalar >::GetDataDimensionality | ( |  | ) |

Gets data dimensionality.

Hmetal T, 16/04/2019.

Returns
  The data dimensionality.

## ◆ GetModelType()

template<typename Scalar >

ModelType NeuralEngine::MachineLearning::IModel< Scalar >::GetModelType | ( |  | ) |

Gets model type.

Hmetal T, 16/04/2019.

Returns
  The model type.

## ◆ SetBatchSize()

template<typename Scalar >

virtual void NeuralEngine::MachineLearning::IModel< Scalar >::SetBatchSize | ( | int | size | ) |
| virtual

Sets batch size.

Hmetal T, 16/04/2019.

Parameters

  size | The size.

## ◆ GetBatchSize()

template<typename Scalar >

int NeuralEngine::MachineLearning::IModel< Scalar >::GetBatchSize | ( |  | ) |

Gets batch size.

Hmetal T, 16/04/2019.

Returns
  The batch size.

## ◆ SetIndexes()

template<typename Scalar >

void NeuralEngine::MachineLearning::IModel< Scalar >::SetIndexes | ( | af::array & | indexes | ) |

Sets the batch indexes.

Hmetal T, 31/08/2020.

## ◆ serialize()

template<typename Scalar >
template<class Archive >

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

Definition at line 231 of file FgIModel.h.

## Friends And Related Function Documentation

## ◆ boost::serialization::access

template<typename Scalar >

friend class boost::serialization::access
| friend

Definition at line 228 of file FgIModel.h.

## Member Data Documentation

## ◆ mType

template<typename Scalar >

ModelType NeuralEngine::MachineLearning::IModel< Scalar >::mType
| protected

Definition at line 218 of file FgIModel.h.

## ◆ iN

template<typename Scalar >

int NeuralEngine::MachineLearning::IModel< Scalar >::iN
| protected

dataset length

Definition at line 220 of file FgIModel.h.

## ◆ iD

template<typename Scalar >

int NeuralEngine::MachineLearning::IModel< Scalar >::iD
| protected

dataset dimension

Definition at line 221 of file FgIModel.h.

## ◆ iBatchSize

template<typename Scalar >

int NeuralEngine::MachineLearning::IModel< Scalar >::iBatchSize
| protected

size of the batch

Definition at line 222 of file FgIModel.h.

## ◆ afIndexes

template<typename Scalar >

af::array NeuralEngine::MachineLearning::IModel< Scalar >::afIndexes
| protected

indexes of /f$\mathbf{X}/f$ for batch learning

Definition at line 223 of file FgIModel.h.

## ◆ m_dType

template<typename Scalar >

af::dtype NeuralEngine::MachineLearning::IModel< Scalar >::m_dType
| protected

floating point precision flag for af::array

Definition at line 225 of file FgIModel.h.

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

- FgIModel.h