Teacher forcing

As seen in the illustration above, when predicting an output at some place in the sequence yt(n), we use yt(n-1) as the input to the LSTM. We then use the output from this time step to predict yt(n+1).

The problem with doing this in training is that if yt(n-1) is wrong, yt(n) will be even more wrong. This chain of increasing wrongness can make things very very slow to train.

A somewhat obvious solution to this problem is to replace each sequence prediction at each time step with the actual correct sequence at that time step. So, rather than using the LSTM prediction for yt(n-1), we would use the actual value from the training set.

We can give the model's training process a boost by using this concept, which happens to be called ...

Get Deep Learning Quick Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.