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;
size_t InputSize() const
Get the input size.
Definition: linear3d.hpp:131
OutputDataType const & OutputParameter() const
Get the output parameter.
Definition: linear3d.hpp:121
OutputDataType & Delta()
Modify the delta.
Definition: linear3d.hpp:128
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.
OutputDataType & OutputParameter()
Modify the output parameter.
Definition: linear3d.hpp:123
OutputDataType const & Gradient() const
Get the gradient.
Definition: linear3d.hpp:137
OutputDataType const & Bias() const
Get the bias of the layer.
Definition: linear3d.hpp:147
OutputDataType & Gradient()
Modify the gradient.
Definition: linear3d.hpp:139
OutputDataType const & Parameters() const
Get the parameters.
Definition: linear3d.hpp:111
OutputDataType & Weight()
Modify the weight of the layer.
Definition: linear3d.hpp:144
InputDataType const & InputParameter() const
Get the input parameter.
Definition: linear3d.hpp:116
OutputDataType & Bias()
Modify the bias weights of the layer.
Definition: linear3d.hpp:149
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...
Definition: linear3d_impl.hpp:145
OutputDataType const & Delta() const
Get the delta.
Definition: linear3d.hpp:126
InputDataType & InputParameter()
Modify the input parameter.
Definition: linear3d.hpp:118
Linear3D & operator=(const Linear3D &layer)
Copy assignment operator.
Definition: linear3d_impl.hpp:71
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...
Definition: linear3d_impl.hpp:112
OutputDataType & Parameters()
Modify the parameters.
Definition: linear3d.hpp:113
size_t InputShape() const
Get the shape of the input.
Definition: linear3d.hpp:152
OutputDataType const & Weight() const
Get the weight of the layer.
Definition: linear3d.hpp:142
void serialize(Archive &ar, const uint32_t)
Serialize the layer.
Definition: linear3d_impl.hpp:219
Linear3D()
Create the Linear3D object.
Definition: linear3d_impl.hpp:23
size_t OutputSize() const
Get the output size.
Definition: linear3d.hpp:134