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

FgAEPSparseDGPLVM.h
1
11#pragma once
12
13#include <MachineLearning/FgSparseDeepGPLVMBaseModel.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 SDGPLVM : public SparseDeepGPLVMBaseModel<Scalar>
67 {
68 public:
80 SDGPLVM(const af::array& Y, int latentDimension, HiddenLayerDescription description, Scalar alpha = 1.0,
81 Scalar priorMean = 0.0, Scalar priorVariance = 1.0, PropagationMode probMode = PropagationMode::MomentMatching,
82 LogLikType lType = LogLikType::Gaussian, XInit emethod = XInit::pca);
83
94 SDGPLVM(const af::array& Y, int latentDimension, std::vector<HiddenLayerDescription> descriptions, Scalar alpha = 1.0,
95 Scalar priorMean = 0.0, Scalar priorVariance = 1.0, PropagationMode probMode = PropagationMode::MomentMatching,
96 LogLikType lType = LogLikType::Gaussian, XInit emethod = XInit::pca);
97
104 SDGPLVM();
105
111 virtual ~SDGPLVM();
112
123 virtual Scalar Function(const af::array& x, af::array& outGradient) override;
124
125 protected:
126
135 void CavityLatents(af::array& mx, af::array& vx);
136
149 af::array CavityGradientLatents(const af::array& dmx, const af::array& dvx, const af::array& m, const af::array& v);
150
163 Scalar ComputePhiLatents(const af::array& mx, const af::array& vx, af::array* dmx = nullptr, af::array* dvx = nullptr);
164
165 private:
166 Scalar dAlpha;
167 PropagationMode pMode;
168
169 friend class boost::serialization::access;
170
171 template<class Archive>
172 void serialize(Archive& ar, unsigned int version)
173 {
174 ar& boost::serialization::base_object<SparseDeepGPLVMBaseModel<Scalar>>(*this);
175 //ar& boost::serialization::make_nvp("SparseDeepGPLVMBaseModel", boost::serialization::base_object<SparseDeepGPLVMBaseModel<Scalar>>(*this));
176 ar& BOOST_SERIALIZATION_NVP(dAlpha);
177 ar& BOOST_SERIALIZATION_NVP(pMode);
178 }
179 };
180 }
181 }
182 }
183}
NeuralEngine::MachineLearning::GPModels::AEP::SDGPLVM
Sparse deep GPLVM via Approximated Expectation Propagation (AEP).
Definition: FgAEPSparseDGPLVM.h:67
NeuralEngine::MachineLearning::GPModels::AEP::SDGPLVM::~SDGPLVM
virtual ~SDGPLVM()
Destructor.
NeuralEngine::MachineLearning::GPModels::AEP::SDGPLVM::SDGPLVM
SDGPLVM(const af::array &Y, int latentDimension, std::vector< HiddenLayerDescription > descriptions, 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::AEP::SDGPLVM::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::SDGPLVM::dAlpha
Scalar dAlpha
fraction parameter
Definition: FgAEPSparseDGPLVM.h:166
NeuralEngine::MachineLearning::GPModels::AEP::SDGPLVM::Function
virtual Scalar Function(const af::array &x, af::array &outGradient) override
Cost function the given parameter inputs.
NeuralEngine::MachineLearning::GPModels::AEP::SDGPLVM::SDGPLVM
SDGPLVM()
Default Constructor.
NeuralEngine::MachineLearning::GPModels::AEP::SDGPLVM::CavityLatents
void CavityLatents(af::array &mx, af::array &vx)
Computes the cavity distribution of the latent points.
NeuralEngine::MachineLearning::GPModels::AEP::SDGPLVM::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::SDGPLVM::SDGPLVM
SDGPLVM(const af::array &Y, int latentDimension, HiddenLayerDescription description, 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::SparseDeepGPLVMBaseModel
Base class with abstract and basic function definitions. All deep GP models will be derived from this...
Definition: FgSparseDeepGPLVMBaseModel.h:50
NeuralEngine::MachineLearning::HiddenLayerDescription
Description of the layer.
Definition: FgIModel.h:36
Scalar
NeuralEngine
Definition: NeArray2.h:18