Element-Research / rnn

Recurrent Neural Network library for Torch7's nn
BSD 3-Clause "New" or "Revised" License
939 stars 313 forks source link

Trouble checkpointing SeqLSTM state #375

Closed cjmcmurtrie closed 7 years ago

cjmcmurtrie commented 7 years ago

I'm working on something where it is useful to run a recurrent network a number of timesteps, then turn back the clock N steps for a backprop step. I am trying to achieve this by saving the first self._output and self.cell tensors, and later setting self.userPrevCell and self.userPrevOutput to what they were at the beginning of the sequence. I am setting the LSTM to :remember('both') so that outputs and cells are not discarded.

However, I cannot for the life of me get it to work after several days of trying. The outputs of the aligned timesteps are close, but not the same!

Is there anything else in SeqLSTM I need to track and set appropriately to achieve this effect?