1. Learn
  2. /
  3. Courses
  4. /
  5. Machine Translation with Keras

Exercise

Defining the Teacher Forcing model

With all the layers created, the next step would be to define a Keras Model object. This model is slightly different to the one that you defined earlier, as the new model has two input layers.

You have been provided with the Keras layers that you implemented in the last exercise including en_inputs, en_gru, de_inputs, de_gru and de_pred.

Instructions

100 XP
  • Import Keras Model object from the models submodule.
  • Define a model that takes the encoder input layer and decoder input layer as inputs (in that order) and outputs the final prediction.
  • Compile the model using the optimizer adam and the loss function categorical_crossentropy.
  • Print the summary of the model.