Base class with abstract and basic function definitions. All deep GP models will be derived from this class.
More...
#include <FgSparseDeepGPSSMBaseModel.h>
Public Member Functions | |
SparseDeepGPSSMBaseModel (const af::array &Y, int latentDimension, HiddenLayerDescription description, Scalar priorMean=0.0, Scalar priorVariance=1.0, af::array &xControl=af::array(), PropagationMode probMode=PropagationMode::MomentMatching, LogLikType lType=LogLikType::Gaussian, XInit emethod=XInit::pca) | |
Constructor. More... | |
SparseDeepGPSSMBaseModel (const af::array &Y, int latentDimension, std::vector< HiddenLayerDescription > descriptions, Scalar priorMean=0.0, Scalar priorVariance=1.0, af::array &xControl=af::array(), PropagationMode probMode=PropagationMode::MomentMatching, LogLikType lType=LogLikType::Gaussian, XInit emethod=XInit::pca) | |
Constructor. More... | |
SparseDeepGPSSMBaseModel () | |
Default Constructor. More... | |
virtual | ~SparseDeepGPSSMBaseModel () |
Destructor. More... | |
virtual bool | Init () override |
Initializes the model. 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 | PredictForward (int numTimeSamples, af::array &my, af::array &vy, int numSamples=200, af::array *mx=nullptr, af::array *vx=nullptr) |
Noise-free Forward prediction. More... | |
virtual int | GetNumParameters () override |
Generate function samples from posterior. More... | |
virtual int | GetNumGPLayerParameters () |
Gets number gp layer parameters. More... | |
virtual void | SetParameters (const af::array ¶m) 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 int | GetNumLayers () |
Gets number of GP layers. More... | |
virtual std::vector< SparseGPBaseLayer< Scalar > * > | GetGPLayers () |
Gets vector of GP layers. More... | |
virtual void | FixKernelParameters (bool isfixed) |
Sets fixation for hyperparameters. More... | |
![]() | |
GPSSBaseModel (const af::array &Y, int latentDimension, Scalar priorMean=0.0, Scalar priorVariance=1.0, af::array &xControl=af::array(), PropagationMode probMode=PropagationMode::MomentMatching, LogLikType lType=LogLikType::Gaussian, bool GPemission=true, bool controlToEmiss=true, XInit emethod=XInit::pca) | |
Constructor. More... | |
GPSSBaseModel () | |
Default constructor. More... | |
virtual | ~GPSSBaseModel () |
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) override |
Optimizes the model parameters for best fit. More... | |
virtual bool | Init (af::array &mx) |
Initializes the model. More... | |
virtual void | PosteriorLatents (af::array &mx, af::array &vx) |
Get posterior distribution of latent variables /f$\mathbf{X}/f$. More... | |
virtual int | GetNumParameters () override |
Gets number of parameters. More... | |
virtual void | SetParameters (const af::array ¶m) override |
Sets the parameters for each optimization iteration. More... | |
virtual af::array | GetParameters () override |
Gets the parameters for each optimization iteration. More... | |
void | UpdateDynamicIndexes () |
Updates the dynamic indexes. More... | |
void | GetLatents (af::array &mx, af::array &vx) |
virtual void | AddWindowData (af::array data) |
![]() | |
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 ¶m) |
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... | |
![]() | |
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 ¶m)=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... | |
![]() | |
GPNode () | |
Default constructor. More... | |
virtual | ~GPNode () |
Destructor. More... | |
int | GetNumChildren () const |
Gets the number of children of this item. More... | |
int | AttachChild (std::shared_ptr< GPNode< Scalar > > const &child) |
Attaches a child. More... | |
int | DetachChild (std::shared_ptr< GPNode< Scalar > > const &child) |
Detaches a child. More... | |
std::shared_ptr< GPNode< Scalar > > | DetachChildAt (int i) |
Detaches a child at index. More... | |
void | DetachAllChildren () |
Detach all children from this node. More... | |
std::shared_ptr< GPNode< Scalar > > | SetChild (int i, std::shared_ptr< GPNode< Scalar > > const &child) |
Sets a child. More... | |
std::shared_ptr< GPNode< Scalar > > | GetChild (int i) |
Gets a child at index. More... | |
GPNode< Scalar > * | GetParent () |
Access to the parent object, which is null for the root of the hierarchy. More... | |
void | SetParent (GPNode< Scalar > *parent) |
Access to the parent object. Node calls this during attach/detach of children. More... | |
Protected Member Functions | |
virtual void | PredictForwardMM (int numTimeSamples, af::array &my, af::array &vy, af::array *mx=nullptr, af::array *vx=nullptr) |
virtual void | PredictForwardMC (int numTimeSamples, af::array &my, af::array &vy, int numSamples=200, af::array *mx=nullptr) |
![]() | |
virtual af::array | PosteriorGradientLatents (const af::array &dmx, const af::array &dvx) |
Posterior gradient of latent inputs /f$\mathbf{X}/f$. More... | |
virtual void | UpdateParametersInternal () |
Updates the parameters. More... | |
![]() | |
IModel (int numData, int numDimension, ModelType type) | |
Constructor. More... | |
Protected Attributes | |
int | iNumLayer |
std::vector< int > | vNumPseudosPerLayer |
std::vector< int > | vSize |
std::vector< HiddenLayerDescription > | vDescription |
SparseGPBaseLayer< Scalar > * | dynLayer |
sparse Gaussian Process dynamic layer More... | |
std::vector< SparseGPBaseLayer< Scalar > * > | gpEmissLayer |
sparse Gaussian Process emission layer More... | |
![]() | |
int | iq |
latent dimension More... | |
int | iDControlEmiss |
int | iDControlDyn |
Scalar | dSn |
bool | bGPemission |
bool | bControlToEmiss |
Scalar | dPriorMean |
prior mean More... | |
Scalar | dPriorVariance |
prior variance More... | |
Scalar | dPriorX1 |
prior /f$x_1/f$ More... | |
Scalar | dPriorX2 |
prior /f$x_2/f$ More... | |
af::array | afFactorX1 |
natural parameter factor 1 for latent variable More... | |
af::array | afFactorX2 |
natural parameter factor 2 for latent variable More... | |
af::array | afPosteriorX1 |
posterior natural parameter 1 for latent variable More... | |
af::array | afPosteriorX2 |
posterior natural parameter 2 for latent variable More... | |
af::array | afXControl |
af::array | afDynIndexes |
af::array | afPriorX1 |
prior /f$x_1/f$ More... | |
af::array | afPriorX2 |
prior /f$x_2/f$ More... | |
af::array | afPriorX1Cav |
prior /f$x_1/f$ More... | |
af::array | afPriorX2Cav |
prior /f$x_2/f$ More... | |
af::array | afPriorMean |
prior mean for hierarchy mode More... | |
af::array | afPriorVariance |
prior variance for hierarchy mode More... | |
af::array | afPriorMeanCav |
prior mean for hierarchy mode More... | |
af::array | afPriorVarianceCav |
prior variance for hierarchy mode More... | |
af::array | afGradMean |
prior mean gradient for hiersrchy mode More... | |
af::array | afGradVariance |
prior variance gradient for hiersrchy mode More... | |
af::array | afGradMeanCav |
prior mean gradient for hiersrchy mode More... | |
af::array | afGradVarianceCav |
prior variance gradient for hiersrchy mode More... | |
af::array | afLatentGradientX |
top down gradient More... | |
XInit | eEmMethod |
PropagationMode | pMode |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
std::vector< std::shared_ptr< GPNode< Scalar > > > | mChild |
GPNode< Scalar > * | mParent |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, unsigned int version) |
Friends | |
class | AEP::SGPLayer< Scalar > |
class | PowerEP::SGPLayer< Scalar > |
class | boost::serialization::access |
Base class with abstract and basic function definitions. All deep GP models will be derived from this class.
HmetalT, 26.10.2017.
Definition at line 49 of file FgSparseDeepGPSSMBaseModel.h.
NeuralEngine::MachineLearning::GPModels::SparseDeepGPSSMBaseModel< Scalar >::SparseDeepGPSSMBaseModel | ( | const af::array & | Y, |
int | latentDimension, | ||
HiddenLayerDescription | description, | ||
Scalar | priorMean = 0.0 , |
||
Scalar | priorVariance = 1.0 , |
||
af::array & | xControl = af::array() , |
||
PropagationMode | probMode = PropagationMode::MomentMatching , |
||
LogLikType | lType = LogLikType::Gaussian , |
||
XInit | emethod = XInit::pca |
||
) |
Constructor.
, 26.03.2018.
Y | The data af::array to process. |
X | The training inputs. |
hiddenLayerdescription | The description for one hidden layer. |
lType | (Optional) the loglik type. |
NeuralEngine::MachineLearning::GPModels::SparseDeepGPSSMBaseModel< Scalar >::SparseDeepGPSSMBaseModel | ( | const af::array & | Y, |
int | latentDimension, | ||
std::vector< HiddenLayerDescription > | descriptions, | ||
Scalar | priorMean = 0.0 , |
||
Scalar | priorVariance = 1.0 , |
||
af::array & | xControl = af::array() , |
||
PropagationMode | probMode = PropagationMode::MomentMatching , |
||
LogLikType | lType = LogLikType::Gaussian , |
||
XInit | emethod = XInit::pca |
||
) |
Constructor.
, 26.03.2018.
Y | The data af::array to process. |
X | The training inputs. |
hiddenLayerdescriptions | The hidden layer descriptions. |
lType | (Optional) the loglik type. |
NeuralEngine::MachineLearning::GPModels::SparseDeepGPSSMBaseModel< Scalar >::SparseDeepGPSSMBaseModel | ( | ) |
Default Constructor.
Hmetal T, 29.11.2017.
|
virtual |
Destructor.
, 23.04.2018.
|
overridevirtual |
Initializes the model.
Hmetal T, 29.11.2017.
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >.
|
overridevirtual |
Predict noise free functions values \(\mathbf{F}_*\).
Hmetal T, 05/05/2020.
testInputs | The test inputs. |
mf | [in,out] mean of function values. |
vf | [in,out] The variance of function values. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >.
|
virtual |
Noise-free Forward prediction.
Hmetal T, 07/05/2020.
numTimeSamples | Number of time samples. |
mf | [in,out] The mean uf \(\matthbf{Y}_*\). |
vf | [in,out] The variance of \(\matthbf{Y}_*\). |
mx | [in,out] (Optional) If non-null, the mx. |
vx | [in,out] (Optional) If non-null, the vx. |
|
overridevirtual |
Generate function samples from posterior.
Hmetal T, 18/06/2019.
outFunctions | [in,out] The out functions. |
inputs | The inputs. |
numSamples | Number of samples. |
Gets number of parameters.
, 26.06.2018.
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPSSBaseModel< Scalar >.
|
virtual |
Gets number gp layer parameters.
HmetalT, 31/03/2020.
|
overridevirtual |
Sets the parameters for each optimization iteration.
, 26.06.2018.
param | The parameter. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPSSBaseModel< Scalar >.
|
overridevirtual |
Gets the parameters for each optimization iteration.
, 26.06.2018.
param | The parameter. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPSSBaseModel< Scalar >.
|
overridevirtual |
Updates the parameters.
, 26.06.2018.
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >.
|
virtual |
Gets number of GP layers.
Hmetal T, 09/07/2019.
|
virtual |
Gets vector of GP layers.
HmetalT, 09/07/2019.
|
virtual |
Sets fixation for hyperparameters.
Hmetal T, 16/12/2019.
isfixed | True if isfixed. |
|
inlineprivate |
Definition at line 236 of file FgSparseDeepGPSSMBaseModel.h.
|
friend |
Definition at line 226 of file FgSparseDeepGPSSMBaseModel.h.
|
friend |
Definition at line 226 of file FgSparseDeepGPSSMBaseModel.h.
|
friend |
Definition at line 233 of file FgSparseDeepGPSSMBaseModel.h.
|
protected |
Definition at line 219 of file FgSparseDeepGPSSMBaseModel.h.
|
protected |
Definition at line 221 of file FgSparseDeepGPSSMBaseModel.h.
|
protected |
Definition at line 222 of file FgSparseDeepGPSSMBaseModel.h.
|
protected |
Definition at line 223 of file FgSparseDeepGPSSMBaseModel.h.
|
protected |
sparse Gaussian Process dynamic layer
Definition at line 225 of file FgSparseDeepGPSSMBaseModel.h.
|
protected |
sparse Gaussian Process emission layer
Definition at line 226 of file FgSparseDeepGPSSMBaseModel.h.