Abstract class for different GP likelihood layers. More...
#include <FgLikelihoodBaseLayer.h>
Public Member Functions | |
LikelihoodBaseLayer (LogLikType type, int numPoints, int outputDim) | |
Constructor. More... | |
virtual 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)=0 |
Calculates the logZ. More... | |
virtual 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)=0 |
Calculates logZ gradients. More... | |
virtual Scalar | BackpropagationGradients (const af::array &mout, const af::array &vout, af::array &dmout, af::array &dvout, Scalar alpha=1.0, Scalar scale=1.0)=0 |
virtual Scalar | ComputeLogLikExp (const af::array &mout, const af::array &vout, const af::array &y)=0 |
virtual void | ComputeLogLikExpGradients (const af::array &mout, const af::array &vout, const af::array &y, af::array *de_dm=nullptr, af::array *de_dv=nullptr)=0 |
virtual Scalar | BackpropagationGradientsLogLikExp (const af::array &mout, const af::array &vout, af::array &dmout, af::array &dvout, af::array &y, Scalar scale=1.0)=0 |
virtual void | ProbabilisticOutput (const af::array &mf, const af::array &vf, af::array &myOut, af::array &vyOut, Scalar alpha=1.0f)=0 |
virtual Scalar | InitParameters () |
LogLikType | GetLogLikType () |
Gets log likelihood type. More... | |
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 | FixParameters (bool isfixed) |
Set to fix the parameters or not for optimization. More... | |
virtual void | UpdateParameters () |
Updates the parameters. 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 | |
LikelihoodBaseLayer () | |
Default constructor. More... | |
![]() | |
ILayer () | |
Default constructor. More... | |
Protected Attributes | |
bool | isFixedParam |
bool | bDimMod |
![]() | |
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) |
Private Attributes | |
LogLikType | lltype |
Friends | |
class | boost::serialization::access |
Abstract class for different GP likelihood layers.
, 27.02.2018.
Definition at line 34 of file FgLikelihoodBaseLayer.h.
NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::LikelihoodBaseLayer | ( | LogLikType | type, |
int | numPoints, | ||
int | outputDim | ||
) |
Constructor.
, 26.04.2018.
type | The likelihood type. |
numPoints | Number of data points. |
outputDim | Dimension of data points. |
|
inlineprotected |
|
pure virtual |
Calculates the logZ.
Hmetal T, 05/05/2018.
mout | [in,out] The mean. |
vout | The standart deviation. |
y | [in,out] Sample data vector. |
alpha | (Optional) Weight between alpha- and KL-divergence. |
Implemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >, and NeuralEngine::MachineLearning::GPModels::ProbitLikLayer< Scalar >.
|
pure virtual |
Calculates logZ gradients.
Hmetal T, 05/05/2018.
mout | [in,out] The mean. |
vout | [in,out] The standart deviation. |
y | [in,out] Sample data vector. |
dlogZ_dm | [in,out] (Optional) If non-null, derivative of logZ w.r.t mean. |
dlogZ_dv | [in,out] (Optional) If non-null, derivative of logZ w.r.t standart deviation. |
dlogZ_dm2 | [in,out] (Optional) If non-null, derivative of logZ w.r.t mean^2. |
Implemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >, and NeuralEngine::MachineLearning::GPModels::ProbitLikLayer< Scalar >.
|
inlinevirtual |
Definition at line 91 of file FgLikelihoodBaseLayer.h.
LogLikType NeuralEngine::MachineLearning::GPModels::LikelihoodBaseLayer< Scalar >::GetLogLikType | ( | ) |
Gets log likelihood type.
, 26.04.2018.
|
virtual |
Gets number of parameters to be optimized.
, 26.06.2018.
Implements NeuralEngine::MachineLearning::ILayer< Scalar >.
Reimplemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >.
|
virtual |
Sets the parameters for each optimization iteration.
, 26.06.2018.
param | The parameter. |
Implements NeuralEngine::MachineLearning::ILayer< Scalar >.
Reimplemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >.
|
virtual |
Gets the parameters for each optimization iteration.
, 26.06.2018.
Implements NeuralEngine::MachineLearning::ILayer< Scalar >.
Reimplemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >.
|
virtual |
Set to fix the parameters or not for optimization.
Hmetal T, 17/12/2019.
isfixed | True if is fixed. |
|
inlinevirtual |
Updates the parameters.
, 26.06.2018.
Implements NeuralEngine::MachineLearning::ILayer< Scalar >.
Reimplemented in NeuralEngine::MachineLearning::GPModels::GaussLikLayer< Scalar >.
Definition at line 143 of file FgLikelihoodBaseLayer.h.
|
inlineprivate |
Definition at line 162 of file FgLikelihoodBaseLayer.h.
|
friend |
Definition at line 159 of file FgLikelihoodBaseLayer.h.
|
protected |
Definition at line 153 of file FgLikelihoodBaseLayer.h.
|
protected |
Definition at line 154 of file FgLikelihoodBaseLayer.h.
|
private |
Definition at line 157 of file FgLikelihoodBaseLayer.h.