diff --git a/src/mlpack/methods/ann/rnn.hpp b/src/mlpack/methods/ann/rnn.hpp index 1b3d8be395..b3029e80d4 100644 --- a/src/mlpack/methods/ann/rnn.hpp +++ b/src/mlpack/methods/ann/rnn.hpp @@ -205,7 +205,11 @@ class RNN //! Serialize the model. template void Serialize(Archive& ar, const unsigned int /* version */); - + + //! Get the maximum number of steps to backpropagate through time (BPTT). + size_t Rho() const { return rho; } + //! Modify the maximum number of steps to backpropagate through time (BPTT). + size_t& Rho() { return rho; } private: // Helper functions. /** @@ -255,6 +259,9 @@ class RNN //! Number of steps to backpropagate through time (BPTT). size_t rho; + //! Number of steps to backpropagate through time (BPTT) at the previous step. + size_t prevRho; + //! Instantiated outputlayer used to evaluate the network. OutputLayerType outputLayer; diff --git a/src/mlpack/methods/ann/rnn_impl.hpp b/src/mlpack/methods/ann/rnn_impl.hpp index 705e072ecc..1028bf6d87 100644 --- a/src/mlpack/methods/ann/rnn_impl.hpp +++ b/src/mlpack/methods/ann/rnn_impl.hpp @@ -22,11 +22,8 @@ #include "visitor/deterministic_set_visitor.hpp" #include "visitor/gradient_set_visitor.hpp" #include "visitor/gradient_visitor.hpp" -<<<<<<< bba7704723aca043c4076008cca07eff8267671b -======= #include "visitor/weight_set_visitor.hpp" #include "visitor/rho_set_visitor.hpp" ->>>>>>> Fixed LSTM baseline bug namespace mlpack { namespace ann /** Artificial Neural Network. */ { @@ -39,14 +36,8 @@ RNN::RNN( OutputLayerType outputLayer, InitializationRuleType initializeRule) : rho(rho), -<<<<<<< bba7704723aca043c4076008cca07eff8267671b outputLayer(std::move(outputLayer)), initializeRule(std::move(initializeRule)), -======= - prevRho(0), - outputLayer(outputLayer), - initializeRule(initializeRule), ->>>>>>> Fixed LSTM baseline bug inputSize(0), outputSize(0), targetSize(0),