16#include <NeMachineLearningLib.h>
17#include <MachineLearning/CommonUtil.h>
22 namespace MachineLearning
36 template<
typename Scalar>
50 ILayer(LayerType type,
int numPoints,
int outputDim)
51 : lType(type), iN(numPoints), iD(outputDim), m_dType(
CommonUtil<
Scalar>::CheckDType()) { }
134 friend class boost::serialization::access;
136 template<
class Archive>
137 void serialize(Archive& ar,
unsigned int version)
139 ar& BOOST_SERIALIZATION_NVP(iD);
140 ar& BOOST_SERIALIZATION_NVP(iN);
141 ar& BOOST_SERIALIZATION_NVP(lType);
142 ar& BOOST_SERIALIZATION_NVP(m_dType);
Abstract class for different kind of layers.
virtual ~ILayer()=default
Destructor.
ILayer(LayerType type, int numPoints, int outputDim)
Constructor.
virtual void UpdateParameters()=0
Updates the parameters.
virtual int GetNumParameters()=0
Gets number of parameters to be optimized.
LayerType lType
liklihood or gp layer
virtual void SetDataSize(int length, int dimension)
Sets data size.
ILayer()
Default constructor.
af::dtype m_dType
floating point precision flag for af::array
LayerType GetType()
Gets the layer type.
virtual void SetParameters(const af::array ¶m)=0
Sets the parameters for each optimization iteration.
virtual af::array GetParameters()=0
Gets the parameters for each optimization iteration.