Correct way to train without teacher forcing

If you do input = proj then backpropagation will flow back through time via the hidden state AND through the previous step’s output. This might be a good thing, but if you don’t want it, then you need one of the following fixes.

  • input = Variable(proj.data) # no need for requires_grad
  • input = proj.detach()