Abstract class for different GP likelihood layers. More...
#include <FgSparseGPBaseLayer.h>
Public Member Functions | |
SparseGPBaseLayer (int numPoints, int numPseudos, int outputDim, int inputDim) | |
Constructor. More... | |
virtual | ~SparseGPBaseLayer () |
Destructor. More... | |
virtual void | ForwardPredictionPost (const af::array *mx, const af::array *vx, af::array &mout, af::array &vout) override |
Forward prediction of posterior function values. More... | |
virtual void | SampleFromPost (const af::array &inX, af::array &outfsample) override |
Samples from posterior. More... | |
void | ComputeKuu () |
Calculates the kernel matrix of pseudo inputs. More... | |
void | ComputeKfu (const af::array &inX) |
Calculates the kernel matrix of inputes and pseudo inputs. More... | |
af::array | GetPseudoInputs () |
Gets pseudo inputs. More... | |
virtual int | GetNumParameters () override |
Gets number of parameters to be optimized. 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 | FixInducing (bool isfixed) |
Set fixation for inducing inputs. More... | |
virtual void | UpdateParameters () override |
Updates the parameters. More... | |
virtual void | InitParameters (af::array *X=nullptr) override |
Initializes the parameters. More... | |
![]() | |
GPBaseLayer (int numPoints, int outputDim, int inputDim) | |
Constructor. More... | |
virtual | ~GPBaseLayer () |
Destructor. More... | |
IKernel< Scalar > * | GetKernel () |
Gets the kernel function. More... | |
void | SetKernel (IKernel< Scalar > *kern) |
Sets a kernel function. More... | |
virtual void | InitParameters (af::array *X=nullptr) |
virtual int | GetNumParameters () |
Gets number of parameters to be optimized. 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 | ForwardPredictionPost (const af::array *mx, const af::array *vx, af::array &mout, af::array &vout) |
Forward prediction of posterior function values. More... | |
virtual void | SampleFromPost (const af::array &inX, af::array &outfsample) |
Samples from posterior. More... | |
virtual void | FixKernelParameters (bool isfixed) |
Sets fixation for hyperparameters. More... | |
virtual void | UpdateParameters () |
Updates the parameters. More... | |
virtual void | SetDataSize (int length, int dimension) override |
Sets data size. More... | |
void | SetStyles (std::map< std::string, Style< Scalar > > *styles) |
Sets the syles. More... | |
void | SetLatentDimension (int q) |
Sets latent dimension. More... | |
![]() | |
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 ¶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... | |
virtual void | SetDataSize (int length, int dimension) |
Sets data size. More... | |
Protected Member Functions | |
SparseGPBaseLayer () | |
Default constructor. More... | |
virtual void | ReinitParameters () override |
Reinitializes the parameters. More... | |
virtual void | ForwardPredictionDeterministicPost (const af::array &mx, af::array *mout, af::array *vout) |
Deterministic forward propagation through posterior. More... | |
virtual void | ForwardPredictionRandomPost (const af::array &mx, const af::array &vx, af::array &mout, af::array &vout, PropagationMode mode=PropagationMode::MomentMatching) |
Forward prediction through random posterior. More... | |
![]() | |
GPBaseLayer () | |
Default constructor. More... | |
virtual void | ReinitParameters () |
Reinitializes the parameters. More... | |
![]() | |
ILayer () | |
Default constructor. More... | |
Protected Attributes | |
int | ik |
af::array | afMu |
af::array | afSu |
af::array | afInvSu |
af::array | afInvSuMu |
af::array | T1 |
af::array | T2 |
af::array | T2_R |
af::array | afXu |
af::array | afKuu |
af::array | afInvKuu |
af::array | afKfu |
bool | isFixedInducing |
![]() | |
int | iq |
Latent dimension. More... | |
bool | isFixedHypers |
IKernel< Scalar > * | kernel |
kernel function More... | |
std::map< std::string, Style< Scalar > > * | mStyles |
style variable More... | |
Scalar | JITTER |
for kernel matrix stability (positive definiteness) More... | |
![]() | |
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) |
Friends | |
class | boost::serialization::access |
Abstract class for different GP likelihood layers.
, 27.02.2018.
Definition at line 34 of file FgSparseGPBaseLayer.h.
NeuralEngine::MachineLearning::GPModels::SparseGPBaseLayer< Scalar >::SparseGPBaseLayer | ( | int | numPoints, |
int | numPseudos, | ||
int | outputDim, | ||
int | inputDim | ||
) |
Constructor.
, 15.05.2018.
numPoints | Number of points. |
numPseudos | Number of pseudo inputs. |
outputDim | The output dimension. |
inputDim | The input dimension. |
|
virtual |
Destructor.
, 15.05.2018.
|
inlineprotected |
|
overridevirtual |
Forward prediction of posterior function values.
, 12.06.2018.
mout | [in,out] The m^{ }_{f}. |
vout | [in,out] The V^{ }_{ff}. |
mx | [in,out] The inputs mx. |
vx | [in,out] (Optional) If non-null, the variances vx. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseLayer< Scalar >.
Reimplemented in NeuralEngine::MachineLearning::GPModels::PowerEP::SGPLayer2nd< Scalar >.
|
overridevirtual |
Samples from posterior.
, 12.06.2018.
vx | [in,out] (Optional) If non-null, the variances vx. |
mx | [in,out] The inputs mx. |
fsample | [in,out] The m^{ }_{f}. |
inX | The V^{ }_{ff}. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseLayer< Scalar >.
void NeuralEngine::MachineLearning::GPModels::SparseGPBaseLayer< Scalar >::ComputeKuu | ( | ) |
Calculates the kernel matrix of pseudo inputs.
, 15.05.2018.
void NeuralEngine::MachineLearning::GPModels::SparseGPBaseLayer< Scalar >::ComputeKfu | ( | const af::array & | inX | ) |
Calculates the kernel matrix of inputes and pseudo inputs.
, 15.05.2018.
af::array NeuralEngine::MachineLearning::GPModels::SparseGPBaseLayer< Scalar >::GetPseudoInputs | ( | ) |
Gets pseudo inputs.
Hmetal T, 17/06/2019.
|
overridevirtual |
Gets number of parameters to be optimized.
, 26.06.2018.
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseLayer< Scalar >.
|
overridevirtual |
Sets the parameters for each optimization iteration.
, 26.06.2018.
param | The parameter. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseLayer< Scalar >.
|
overridevirtual |
Gets the parameters for each optimization iteration.
, 26.06.2018.
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseLayer< Scalar >.
|
virtual |
Set fixation for inducing inputs.
Hmetal T, 16/12/2019.
isfixed | True if isfixed. |
|
overridevirtual |
Updates the parameters.
, 26.06.2018.
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseLayer< Scalar >.
Reimplemented in NeuralEngine::MachineLearning::GPModels::AEP::SGPLayer< Scalar >, NeuralEngine::MachineLearning::GPModels::PowerEP::SGPLayer< Scalar >, and NeuralEngine::MachineLearning::GPModels::PowerEP::SGPLayer2nd< Scalar >.
|
overridevirtual |
Initializes the parameters.
Hmetal T, 09/12/2019.
X | [in,out] (Optional) If non-null, an af::array to process. |
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseLayer< Scalar >.
Reimplemented in NeuralEngine::MachineLearning::GPModels::PowerEP::SGPLayer< Scalar >, and NeuralEngine::MachineLearning::GPModels::PowerEP::SGPLayer2nd< Scalar >.
|
overrideprotectedvirtual |
Reinitializes the parameters.
Hmetal T, 03/09/2020.
Reimplemented from NeuralEngine::MachineLearning::GPModels::GPBaseLayer< Scalar >.
|
protectedvirtual |
Deterministic forward propagation through posterior.
Hmetal T, 01.04.2019.
mx | [in,out] The inputs mx. |
mout | [in,out] The m^{ }_{f}. |
vout | [in,out] The V^{ }_{ff}. |
Reimplemented in NeuralEngine::MachineLearning::GPModels::AEP::SGPLayer< Scalar >.
|
protectedvirtual |
Forward prediction through random posterior.
, 16.05.2018.
mx | The inputs mx. |
vx | If non-null, the variances vx. |
mout | [in,out] The m^{ }_{f}. |
vout | [in,out] The V^{ }_{ff}. |
mode | (Optional) Propagation mode. |
Reimplemented in NeuralEngine::MachineLearning::GPModels::AEP::SGPLayer< Scalar >.
|
inlineprivate |
Definition at line 221 of file FgSparseGPBaseLayer.h.
|
friend |
Definition at line 218 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 198 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 200 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 201 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 202 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 203 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 206 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 207 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 208 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 210 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 211 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 212 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 213 of file FgSparseGPBaseLayer.h.
|
protected |
Definition at line 215 of file FgSparseGPBaseLayer.h.