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());
70 void Forward(
const arma::Mat<eT>& input, arma::Mat<eT>& output);
83 const arma::Mat<eT>& gy,
95 const arma::Mat<eT>& error,
96 arma::Mat<eT>& gradient);
99 OutputDataType
const&
Parameters()
const {
return weights; }
114 OutputDataType
const&
Delta()
const {
return delta; }
116 OutputDataType&
Delta() {
return delta; }
125 OutputDataType
const&
Gradient()
const {
return gradient; }
130 OutputDataType
const&
Weight()
const {
return weight; }
132 OutputDataType&
Weight() {
return weight; }
135 OutputDataType
const&
Bias()
const {
return bias; }
137 OutputDataType&
Bias() {
return bias; }
142 template<
typename Archive>
153 OutputDataType weights;
156 OutputDataType weight;
162 OutputDataType delta;
165 OutputDataType gradient;
168 InputDataType inputParameter;
171 OutputDataType outputParameter;
174 RegularizerType regularizer;
181#include "linear3d_impl.hpp"
Implementation of the Linear3D layer class.
OutputDataType const & Delta() const
Get the delta.
OutputDataType const & Parameters() const
Get the parameters.
OutputDataType const & Weight() const
Get the weight of the layer.
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...
OutputDataType & Weight()
Modify the weight of the layer.
OutputDataType const & Bias() const
Get the bias of the layer.
InputDataType & InputParameter()
Modify the input parameter.
OutputDataType const & OutputParameter() const
Get the output parameter.
size_t InputSize() const
Get the input size.
size_t OutputSize() const
Get the output size.
void Gradient(const arma::Mat< eT > &input, const arma::Mat< eT > &error, arma::Mat< eT > &gradient)
OutputDataType const & Gradient() const
Get the gradient.
Linear3D(const size_t inSize, const size_t outSize, RegularizerType regularizer=RegularizerType())
Create the Linear3D layer object using the specified number of units.
InputDataType const & InputParameter() const
Get the input parameter.
Linear3D()
Create the Linear3D object.
OutputDataType & Bias()
Modify the bias weights of the layer.
OutputDataType & Gradient()
Modify the gradient.
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 & OutputParameter()
Modify the output parameter.
void serialize(Archive &ar, const unsigned int)
Serialize the layer.
OutputDataType & Parameters()
Modify the parameters.
OutputDataType & Delta()
Modify the delta.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.