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

FgGaussEmissionLayer.h
1
11#pragma once
12
13#include <MachineLearning/FgILayer.h>
14
15
16 namespace NeuralEngine
17{
18 namespace MachineLearning
19 {
20 namespace GPModels
21 {
22
65 template<typename Scalar>
66 class NE_IMPEXP GaussEmission : public ILayer<Scalar>
67 {
68 public:
69
79
80 GaussEmission(const af::array& y, int outputDim, int inputDim);
81
87 virtual ~GaussEmission();
88
100 virtual void ProbabilisticOutput(const af::array& mf, const af::array& vf, af::array& myOut, af::array& vyOut, Scalar alpha = 1.0f);
101
116 virtual Scalar ComputeLogZEmission(const af::array& mx, const af::array& vx, const af::array& y,
117 const Scalar scale, std::map<std::string, af::array>* outGradInput, af::array& outHyperGrad, Scalar alpha = 1.0);
118
126 virtual int GetNumParameters();
127
135 virtual void SetParameters(const af::array& param);
136
144 virtual af::array GetParameters();
145
151 virtual void UpdateParameters();
152
153 virtual void InitParameters();
154
155 GaussEmission();
156
157 protected:
158
164
165 af::array afY;
166 af::array afU;
167 af::array afR;
168
169 int iq;
170
171
172 private:
173 friend class boost::serialization::access;
174
175 template<class Archive>
176 void serialize(Archive& ar, unsigned int version)
177 {
178 ar& boost::serialization::base_object<ILayer<Scalar>>(*this);
179
180 ar& BOOST_SERIALIZATION_NVP(afU);
181 ar& BOOST_SERIALIZATION_NVP(afR);
182 ar& BOOST_SERIALIZATION_NVP(iq);
183 }
184 };
185 }
186 }
187}
NeuralEngine::MachineLearning::GPModels::GaussEmission
Likelihood emission layer for State Space Models based on Gaussian distribution.
Definition: FgGaussEmissionLayer.h:67
NeuralEngine::MachineLearning::GPModels::GaussEmission::ProbabilisticOutput
virtual void ProbabilisticOutput(const af::array &mf, const af::array &vf, af::array &myOut, af::array &vyOut, Scalar alpha=1.0f)
Probabilistic output.
NeuralEngine::MachineLearning::GPModels::GaussEmission::SetParameters
virtual void SetParameters(const af::array &param)
Sets the parameters for each optimization iteration.
NeuralEngine::MachineLearning::GPModels::GaussEmission::ComputeLogZEmission
virtual Scalar ComputeLogZEmission(const af::array &mx, const af::array &vx, const af::array &y, const Scalar scale, std::map< std::string, af::array > *outGradInput, af::array &outHyperGrad, Scalar alpha=1.0)
Calculates tilted distribution and its gradients.
NeuralEngine::MachineLearning::GPModels::GaussEmission::UpdateParameters
virtual void UpdateParameters()
Updates the parameters.
NeuralEngine::MachineLearning::GPModels::GaussEmission::GetNumParameters
virtual int GetNumParameters()
Gets number of parameters to be optimized.
NeuralEngine::MachineLearning::GPModels::GaussEmission::~GaussEmission
virtual ~GaussEmission()
Destructor.
NeuralEngine::MachineLearning::GPModels::GaussEmission::GetParameters
virtual af::array GetParameters()
Gets the parameters for each optimization iteration.
NeuralEngine::MachineLearning::GPModels::GaussEmission::afY
af::array afY
Default constructor.
Definition: FgGaussEmissionLayer.h:165
NeuralEngine::MachineLearning::GPModels::GaussEmission::GaussEmission
GaussEmission(const af::array &y, int outputDim, int inputDim)
Constructor.
NeuralEngine::MachineLearning::ILayer
Abstract class for different kind of layers.
Definition: FgILayer.h:38
Scalar
NeuralEngine
Definition: NeArray2.h:18