13 #ifndef MLPACK_METHODS_ANN_LAYER_LSTM_HPP 14 #define MLPACK_METHODS_ANN_LAYER_LSTM_HPP 18 #include <boost/ptr_container/ptr_vector.hpp> 20 #include "../visitor/delta_visitor.hpp" 21 #include "../visitor/output_parameter_visitor.hpp" 43 typename InputDataType = arma::mat,
44 typename OutputDataType = arma::mat
69 void Forward(arma::Mat<eT>&& input, arma::Mat<eT>&& output);
81 void Backward(
const arma::Mat<eT>&& ,
138 template<
typename Archive>
139 void Serialize(Archive& ar,
const unsigned int );
238 #include "lstm_impl.hpp"
LayerTypes output2GateModule
Locally-stored output 2 gate module.
arma::mat prevCell
Locally-stored previous cell state.
arma::mat prevOutput
Locally-stored previous output.
Linear algebra utility functions, generally performed on matrices or vectors.
OutputParameterVisitor outputParameterVisitor
Locally-stored output parameter visitor.
InputDataType const & InputParameter() const
Get the input parameter.
size_t outSize
Locally-stored number of output units.
OutputDataType & OutputParameter()
Modify the output parameter.
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...
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t inSize
Locally-stored number of input units.
std::vector< LayerTypes > & Model()
Get the model modules.
std::vector< LayerTypes > network
Locally-stored list of network modules.
OutputDataType & Parameters()
Modify the parameters.
size_t gradientStep
Locally-stored number of gradient steps.
LayerTypes cellActivationModule
Locally-stored cell activation module.
size_t & Rho()
Modify the maximum number of steps to backpropagate through time (BPTT).
OutputDataType delta
Locally-stored delta object.
LayerTypes forgetGateModule
Locally-stored forget gate module.
DeltaVisitor deltaVisitor
Locally-stored delta visitor.
LayerTypes inputGateModule
Locally-stored input gate module.
OutputDataType const & Delta() const
Get the delta.
OutputDataType const & Parameters() const
Get the parameters.
OutputDataType gradient
Locally-stored gradient object.
OutputParameterVisitor exposes the output parameter of the given module.
size_t Rho() const
Get the maximum number of steps to backpropagate through time (BPTT).
InputDataType inputParameter
Locally-stored input parameter object.
size_t rho
Number of steps to backpropagate through time (BPTT).
void Serialize(Archive &ar, const unsigned int)
Serialize the layer.
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 & Gradient()
Modify the gradient.
OutputDataType outputParameter
Locally-stored output parameter object.
size_t forwardStep
Locally-stored number of forward steps.
LayerTypes outputGateModule
Locally-stored output gate module.
LayerTypes input2GateModule
Locally-stored input 2 gate module.
bool & Deterministic()
Modify the value of the deterministic parameter.
OutputDataType const & OutputParameter() const
Get the output parameter.
arma::mat forgetGateError
Locally-stored foget gate error.
LayerTypes cellModule
Locally-stored cell module.
bool deterministic
If true dropout and scaling is disabled, see notes above.
DeltaVisitor exposes the delta parameter of the given module.
OutputDataType & Delta()
Modify the delta.
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...
std::vector< arma::mat > cellParameter
Locally-stored cell parameters.
LSTM()
Create the LSTM object.
OutputDataType const & Gradient() const
Get the gradient.
LayerTypes hiddenStateModule
Locally-stored hidden state module.
InputDataType & InputParameter()
Modify the input parameter.
std::vector< arma::mat > outParameter
Locally-stored output parameters.
bool Deterministic() const
The value of the deterministic parameter.
size_t backwardStep
Locally-stored number of backward steps.
arma::mat prevError
Locally-stored previous error.
arma::mat cellActivationError
Locally-stored cell activation error.
OutputDataType weights
Locally-stored weight object.