Session Ready
Exercise

Training the model with validation

Here you will train the model using Teacher Forcing and also perform a validation step. You will train the model for multiple epochs and multiple iterations. Then at the end of each epoch, you will run the validation step and obtain the results.

For this, you have been provided with en_text (English sentences), fr_text (French sentences), the sents2seqs() function and nmt_tf (the compiled model). You also have tr_en and tr_fr (training data) and v_en and v_fr (validation data) loaded already.

Instructions
100 XP
  • Extract decoder inputs (all words except the last) and outputs (all words except the first) from de_xy.
  • Train the model on a single batch of data.
  • Create decoder inputs and outputs from the validation data similar to how you did for training data.
  • Evaluate the model on the validation dataset to obtain the validation loss and the accuracy.