13 #ifndef MLPACK_METHODS_ANN_LAYER_LINEAR3D_HPP 14 #define MLPACK_METHODS_ANN_LAYER_LINEAR3D_HPP 36 typename InputDataType = arma::mat,
37 typename OutputDataType = arma::mat,
38 typename RegularizerType = NoRegularizer
55 RegularizerType regularizer = RegularizerType());
82 void Forward(
const arma::Mat<eT>& input, arma::Mat<eT>& output);
95 const arma::Mat<eT>& gy,
105 template<
typename eT>
106 void Gradient(
const arma::Mat<eT>& input,
107 const arma::Mat<eT>& error,
108 arma::Mat<eT>& gradient);
126 OutputDataType
const&
Delta()
const {
return delta; }
128 OutputDataType&
Delta() {
return delta; }
137 OutputDataType
const&
Gradient()
const {
return gradient; }
142 OutputDataType
const&
Weight()
const {
return weight; }
144 OutputDataType&
Weight() {
return weight; }
147 OutputDataType
const&
Bias()
const {
return bias; }
149 OutputDataType&
Bias() {
return bias; }
160 template<
typename Archive>
161 void serialize(Archive& ar,
const uint32_t );
171 OutputDataType weights;
174 OutputDataType weight;
180 OutputDataType delta;
183 OutputDataType gradient;
186 InputDataType inputParameter;
189 OutputDataType outputParameter;
192 RegularizerType regularizer;
199 #include "linear3d_impl.hpp" OutputDataType const & Gradient() const
Get the gradient.
OutputDataType & Weight()
Modify the weight of the layer.
Linear algebra utility functions, generally performed on matrices or vectors.
OutputDataType const & OutputParameter() const
Get the output parameter.
OutputDataType const & Parameters() const
Get the parameters.
Linear3D()
Create the Linear3D object.
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType & OutputParameter()
Modify the output parameter.
size_t InputSize() const
Get the input size.
OutputDataType const & Delta() const
Get the delta.
OutputDataType const & Weight() const
Get the weight of the layer.
InputDataType const & InputParameter() const
Get the input parameter.
size_t OutputSize() const
Get the output size.
OutputDataType & Bias()
Modify the bias weights of the layer.
size_t InputShape() const
Get the shape of the input.
OutputDataType const & Bias() const
Get the bias of the layer.
OutputDataType & Parameters()
Modify the parameters.
Linear3D & operator=(const Linear3D &layer)
Copy assignment operator.
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
OutputDataType & Gradient()
Modify the gradient.
void Forward(const arma::Mat< eT > &input, arma::Mat< eT > &output)
Ordinary feed forward pass of a neural network, evaluating the function f(x) by propagating the activ...
InputDataType & InputParameter()
Modify the input parameter.
void Backward(const arma::Mat< eT > &, const arma::Mat< eT > &gy, arma::Mat< eT > &g)
Ordinary feed backward pass of a neural network, calculating the function f(x) by propagating x backw...
OutputDataType & Delta()
Modify the delta.