Lesson 11 teacher forcing in fastai v1

Hello, I’m very grateful for the course and all the hard work that has been done.

Currently I’m having trouble with getting the Seq2SeqStepper used for teacher forcing to work in the new fastai v1 library, mostly because I’m not sure how to pass the stepper into the fit function.

So, in this notebook - https://github.com/fastai/fastai/blob/master/courses/dl2/translate.ipynb
Under the heading “Teacher Forcing”, there is the function Seq2SeqStepper, which inherits from Stepper.

But how do you pass it into the fit function, as it no longer has the stepper parameter?
I’ve been trying to pass it in as a callback, reading http://docs.fast.ai/callback.html , but I’m not exactly sure how to do that properly, as it seems that it can’t be passed.

Would really help, if someone could provide an example with stepper, for the new fastai v1 library.
Thank you :slight_smile:

1 Like