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

FgProbitLikelihoodLayer.h
1
11#pragma once
12
13#include <MachineLearning/FgLikelihoodBaseLayer.h>
14
15 namespace NeuralEngine
16{
17 namespace MachineLearning
18 {
19 namespace GPModels
20 {
49 template<typename Scalar>
50 class NE_IMPEXP ProbitLikLayer : public LikelihoodBaseLayer<Scalar>
51 {
52 public:
53
62 ProbitLikLayer(int numPoints, int outputDim);
63
76 Scalar ComputeLogZ(const af::array& mout, const af::array& vout, const af::array& y, Scalar alpha = 1.0, af::array* dlogZ_dm = nullptr,
77 af::array* dlogZ_dv = nullptr, af::array* dlogZ_dm2 = nullptr);
78
91 void ComputeLogZGradients(const af::array& mout, const af::array& vout, const af::array& y, af::array* dlogZ_dm = nullptr,
92 af::array* dlogZ_dv = nullptr, af::array* dlogZ_dm2 = nullptr, Scalar alpha = 1.0);
93
94 Scalar ComputeLogLikExp(const af::array& mout, const af::array& vout, const af::array& y);
95
96 void ComputeLogLikExpGradients(const af::array& mout, const af::array& vout, const af::array& y, af::array* de_dm = nullptr, af::array* de_dv = nullptr);
97
98 Scalar BackpropagationGradientsLogLikExp(const af::array& mout, const af::array& vout, af::array& dmout, af::array& dvout, af::array& y, Scalar scale = 1.0);
99
100 Scalar BackpropagationGradients(const af::array& mout, const af::array& vout, af::array& dmout, af::array& dvout, Scalar alpha = 1.0, Scalar scale = 1.0);
101
102 void ProbabilisticOutput(const af::array& mf, const af::array& vf, af::array& myOut, af::array& vyOut, Scalar alpha = 1.0f);
103
104 protected:
105 ProbitLikLayer() { }
106
107 // Quadrature points
108 af::array afGHx;
109 af::array afGHw;
110 private:
111
112 friend class boost::serialization::access;
113
114 template<class Archive>
115 void serialize(Archive& ar, unsigned int version)
116 {
117 ar& boost::serialization::base_object<LikelihoodBaseLayer<Scalar>>(*this);
118 //ar& _sn;
119 }
120 };
121 }
122 }
123}
NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer
Abstract class for different GP likelihood layers.
Definition: FgLikelihoodBaseLayer.h:35
NeuralEngine::MachineLearning::GPModels::ProbitLikLayer
Likelihood estimation based on Probit distribution.
Definition: FgProbitLikelihoodLayer.h:51
NeuralEngine::MachineLearning::GPModels::ProbitLikLayer::ComputeLogZ
Scalar ComputeLogZ(const af::array &mout, const af::array &vout, const af::array &y, Scalar alpha=1.0, af::array *dlogZ_dm=nullptr, af::array *dlogZ_dv=nullptr, af::array *dlogZ_dm2=nullptr)
Calculates the logZ.
NeuralEngine::MachineLearning::GPModels::ProbitLikLayer::ComputeLogZGradients
void ComputeLogZGradients(const af::array &mout, const af::array &vout, const af::array &y, af::array *dlogZ_dm=nullptr, af::array *dlogZ_dv=nullptr, af::array *dlogZ_dm2=nullptr, Scalar alpha=1.0)
Calculates the logZ gradients.
NeuralEngine::MachineLearning::GPModels::ProbitLikLayer::ProbitLikLayer
ProbitLikLayer(int numPoints, int outputDim)
Constructor.
Scalar
NeuralEngine
Definition: NeArray2.h:18