13 #ifndef MLPACK_METHODS_ANN_LAYER_RECURRENT_HPP 14 #define MLPACK_METHODS_ANN_LAYER_RECURRENT_HPP 17 #include <boost/ptr_container/ptr_vector.hpp> 19 #include "../visitor/delta_visitor.hpp" 20 #include "../visitor/output_parameter_visitor.hpp" 21 #include "../visitor/weight_size_visitor.hpp" 40 typename InputDataType = arma::mat,
41 typename OutputDataType = arma::mat
55 template<
typename StartModuleType,
56 typename InputModuleType,
57 typename FeedbackModuleType,
58 typename TransferModuleType>
60 const InputModuleType& input,
61 const FeedbackModuleType& feedback,
62 const TransferModuleType& transfer,
73 void Forward(arma::Mat<eT>&& input, arma::Mat<eT>&& output);
85 void Backward(
const arma::Mat<eT>&& ,
98 arma::Mat<eT>&& error,
137 template<
typename Archive>
138 void Serialize(Archive& ar,
const unsigned int );
215 #include "recurrent_impl.hpp" OutputDataType const & Gradient() const
Get the gradient.
void Backward(const arma::Mat< eT > &&, 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 gradient
Locally-stored gradient object.
LayerTypes feedbackModule
Locally-stored feedback module.
size_t forwardStep
Locally-stored number of forward steps.
InputDataType inputParameter
Locally-stored input parameter object.
OutputDataType const & Parameters() const
Get the parameters.
OutputDataType & OutputParameter()
Modify the output parameter.
InputDataType & InputParameter()
Modify the input parameter.
bool Deterministic() const
The value of the deterministic parameter.
Linear algebra utility functions, generally performed on matrices or vectors.
size_t backwardStep
Locally-stored number of backward steps.
WeightSizeVisitor weightSizeVisitor
Locally-stored weight size visitor.
bool & Deterministic()
Modify the value of the deterministic parameter.
void Serialize(Archive &ar, const unsigned int)
Serialize the layer.
OutputDataType parameters
Locally-stored weight object.
LayerTypes mergeModule
Locally-stored merge module.
WeightSizeVisitor returns the number of weights of the given module.
Recurrent(const StartModuleType &start, const InputModuleType &input, const FeedbackModuleType &feedback, const TransferModuleType &transfer, const size_t rho)
Create the Recurrent object using the specified modules.
OutputDataType & Delta()
Modify the delta.
std::vector< LayerTypes > network
Locally-stored model modules.
OutputParameterVisitor outputParameterVisitor
Locally-stored output parameter visitor.
OutputDataType & Gradient()
Modify the gradient.
OutputDataType outputParameter
Locally-stored output parameter object.
OutputDataType const & OutputParameter() const
Get the output parameter.
std::vector< arma::mat > feedbackOutputParameter
Locally-stored feedback output parameters.
LayerTypes startModule
Locally-stored start module.
OutputParameterVisitor exposes the output parameter of the given module.
OutputDataType const & Delta() const
Get the delta.
boost::variant< Add< arma::mat, arma::mat > *, AddMerge< arma::mat, arma::mat > *, BaseLayer< LogisticFunction, arma::mat, arma::mat > *, BaseLayer< IdentityFunction, arma::mat, arma::mat > *, BaseLayer< TanhFunction, arma::mat, arma::mat > *, BaseLayer< RectifierFunction, arma::mat, arma::mat > *, Concat< arma::mat, arma::mat > *, ConcatPerformance< NegativeLogLikelihood< arma::mat, arma::mat >, arma::mat, arma::mat > *, Constant< arma::mat, arma::mat > *, Convolution< NaiveConvolution< ValidConvolution >, NaiveConvolution< FullConvolution >, NaiveConvolution< ValidConvolution >, arma::mat, arma::mat > *, DropConnect< arma::mat, arma::mat > *, Dropout< arma::mat, arma::mat > *, Glimpse< arma::mat, arma::mat > *, HardTanH< arma::mat, arma::mat > *, Join< arma::mat, arma::mat > *, LeakyReLU< arma::mat, arma::mat > *, Linear< arma::mat, arma::mat > *, LinearNoBias< arma::mat, arma::mat > *, LogSoftMax< arma::mat, arma::mat > *, Lookup< arma::mat, arma::mat > *, LSTM< arma::mat, arma::mat > *, MaxPooling< arma::mat, arma::mat > *, MeanPooling< arma::mat, arma::mat > *, MeanSquaredError< arma::mat, arma::mat > *, MultiplyConstant< arma::mat, arma::mat > *, NegativeLogLikelihood< arma::mat, arma::mat > *, PReLU< arma::mat, arma::mat > *, Recurrent< arma::mat, arma::mat > *, RecurrentAttention< arma::mat, arma::mat > *, ReinforceNormal< arma::mat, arma::mat > *, Select< arma::mat, arma::mat > *, Sequential< arma::mat, arma::mat > *, VRClassReward< arma::mat, arma::mat > * > LayerTypes
OutputDataType & Parameters()
Modify the parameters.
std::vector< LayerTypes > & Model()
Get the model modules.
DeltaVisitor deltaVisitor
Locally-stored delta visitor.
arma::mat recurrentError
Locally-stored recurrent error parameter.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
LayerTypes initialModule
Locally-stored initial module.
LayerTypes transferModule
Locally-stored transfer module.
DeltaVisitor exposes the delta parameter of the given module.
bool deterministic
If true dropout and scaling is disabled, see notes above.
OutputDataType delta
Locally-stored delta object.
LayerTypes inputModule
Locally-stored input module.
InputDataType const & InputParameter() const
Get the input parameter.
size_t gradientStep
Locally-stored number of gradient steps.
size_t rho
Number of steps to backpropagate through time (BPTT).
LayerTypes recurrentModule
Locally-stored recurrent module.
void Forward(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...