Base class with abstract and basic function definitions. All deep GP models will be derived from this class.
More...
#include <FgDeepGPBaseModel.h>
Public Member Functions | |
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 ¶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 std::vector< GPBaseLayer< Scalar > * > | GetGPLayers () |
Gets vector of GP layers. More... | |
virtual void | FixKernelParameters (bool isfixed) |
Sets fixation for hyperparameters. More... | |
![]() | |
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... | |
Protected Attributes | |
int | iNumLayer |
std::vector< int > | vNumPseudosPerLayer |
std::vector< int > | vSize |
std::vector< GPBaseLayer< Scalar > * > | gpLayer |
![]() | |
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... | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, unsigned int version) |
Friends | |
class | boost::serialization::access |
class | AEP::SGPLayer< Scalar > |
class | PowerEP::SGPLayer< Scalar > |
Additional Inherited Members | |
![]() | |
IModel (int numData, int numDimension, ModelType type) | |
Constructor. More... | |
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 50 of file FgDeepGPBaseModel.h.
NeuralEngine::MachineLearning::GPModels::DeepGPBaseModel< Scalar >::DeepGPBaseModel | ( | const af::array & | Y, |
HiddenLayerDescription | hiddenLayerdescription, | ||
LogLikType | lType = LogLikType::Gaussian |
||
) |
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::DeepGPBaseModel< Scalar >::DeepGPBaseModel | ( | const af::array & | Y, |
std::vector< HiddenLayerDescription > | descriptions, | ||
LogLikType | lType = LogLikType::Gaussian |
||
) |
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::DeepGPBaseModel< Scalar >::DeepGPBaseModel | ( | ) |
Default Constructor.
Hmetal T, 29.11.2017.
|
virtual |
Destructor.
, 23.04.2018.
|
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 >.
|
overridevirtual |
Generate function samples from posterior.
Hmetal T, 18/06/2019.
outFunctions | [in,out] The out functions. |
inputs | The inputs. |
numSamples | Number of samples. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >.
|
overridevirtual |
Gets number of parameters.
, 26.06.2018.
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >.
|
virtual |
Gets number of GP layers.
Hmetal T, 09/07/2019.
|
overridevirtual |
Sets the parameters for each optimization iteration.
, 26.06.2018.
param | The parameter. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >.
|
overridevirtual |
Gets the parameters for each optimization iteration.
, 26.06.2018.
param | The parameter. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >.
|
overridevirtual |
Updates the parameters.
, 26.06.2018.
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseModel< Scalar >.
|
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 192 of file FgDeepGPBaseModel.h.
|
friend |
Definition at line 185 of file FgDeepGPBaseModel.h.
|
friend |
Definition at line 185 of file FgDeepGPBaseModel.h.
|
friend |
Definition at line 185 of file FgDeepGPBaseModel.h.
|
protected |
Definition at line 177 of file FgDeepGPBaseModel.h.
|
protected |
Definition at line 179 of file FgDeepGPBaseModel.h.
|
protected |
Definition at line 180 of file FgDeepGPBaseModel.h.
|
protected |
Definition at line 182 of file FgDeepGPBaseModel.h.