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

FgAEPSparseGPLVM.h
1
11#pragma once
12
13#include <MachineLearning/FgSparseGPLVMBaseModel.h>
14
15 namespace NeuralEngine
16{
17 namespace MachineLearning
18 {
19 namespace GPModels
20 {
21 namespace AEP
22 {
23
65 template<typename Scalar>
66 class NE_IMPEXP SGPLVM : public SparseGPLVMBaseModel<Scalar>
67 {
68 public:
83 SGPLVM(const af::array& Y, int latentDimension, int numInducing = 200, Scalar alpha = 1.0, Scalar priorMean = 0.0, Scalar priorVariance = 1.0,
84 PropagationMode probMode = PropagationMode::MomentMatching, LogLikType lType = LogLikType::Gaussian, XInit emethod = XInit::pca);
85
91 SGPLVM();
92
103 virtual Scalar Function(const af::array& x, af::array& outGradient) override;
104
105 protected:
106
115 void CavityLatents(af::array& mx, af::array& vx);
116
129 af::array CavityGradientLatents(const af::array& dmx, const af::array& dvx, const af::array& m, const af::array& v);
130
143 Scalar ComputePhiLatents(const af::array& mx, const af::array& vx, af::array* dmx = nullptr, af::array* dvx = nullptr);
144
145
146 private:
147 Scalar dAlpha;
148 PropagationMode pMode;
149
150 friend class boost::serialization::access;
151
152 template<class Archive>
153 void serialize(Archive& ar, unsigned int version)
154 {
155 ar& boost::serialization::base_object<SparseGPLVMBaseModel<Scalar>>(*this);
156 //ar& boost::serialization::make_nvp("SparseGPLVMBaseModel", boost::serialization::base_object<SparseGPLVMBaseModel<Scalar>>(*this));
157 ar& BOOST_SERIALIZATION_NVP(dAlpha);
158 ar& BOOST_SERIALIZATION_NVP(pMode);
159 }
160 };
161 }
162 }
163 }
164}
NeuralEngine::MachineLearning::GPModels::AEP::SGPLVM
Sparse GPLVM via Approximated Expectation Propagation (AEP).
Definition: FgAEPSparseGPLVM.h:67
NeuralEngine::MachineLearning::GPModels::AEP::SGPLVM::CavityLatents
void CavityLatents(af::array &mx, af::array &vx)
Computes the cavity distribution of the latent points.
NeuralEngine::MachineLearning::GPModels::AEP::SGPLVM::Function
virtual Scalar Function(const af::array &x, af::array &outGradient) override
Cost function the given parameter inputs.
NeuralEngine::MachineLearning::GPModels::AEP::SGPLVM::SGPLVM
SGPLVM()
Default constructor.
NeuralEngine::MachineLearning::GPModels::AEP::SGPLVM::dAlpha
Scalar dAlpha
fraction parameter
Definition: FgAEPSparseGPLVM.h:147
NeuralEngine::MachineLearning::GPModels::AEP::SGPLVM::CavityGradientLatents
af::array CavityGradientLatents(const af::array &dmx, const af::array &dvx, const af::array &m, const af::array &v)
Gradient of the cavity distribution w.r.t. latent points.
NeuralEngine::MachineLearning::GPModels::AEP::SGPLVM::ComputePhiLatents
Scalar ComputePhiLatents(const af::array &mx, const af::array &vx, af::array *dmx=nullptr, af::array *dvx=nullptr)
Calculates the likelihood contribution of the latent points and its gradients.
NeuralEngine::MachineLearning::GPModels::AEP::SGPLVM::SGPLVM
SGPLVM(const af::array &Y, int latentDimension, int numInducing=200, Scalar alpha=1.0, Scalar priorMean=0.0, Scalar priorVariance=1.0, PropagationMode probMode=PropagationMode::MomentMatching, LogLikType lType=LogLikType::Gaussian, XInit emethod=XInit::pca)
Constructor.
NeuralEngine::MachineLearning::GPModels::SparseGPLVMBaseModel
Base class for all sparse GPLVM models.
Definition: FgSparseGPLVMBaseModel.h:79
Scalar
NeuralEngine
Definition: NeArray2.h:18