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

Connected

Exercise

Part 1: Defining the full model

Here you will be implementing the last few layers of the encoder-decoder model. You will be using Dense and TimeDistributed layers to get the final predictions (i.e. predicted French word probabilities) of the encoder-decoder model.

You are provided with the encoder and decoder (without the top-part) you implemented so far. The decoder GRU layer's output de_out is provided. We use the prefix en (e.g. en_gru) to indicate anything encoder related and de to indicate decoder related things (e.g. de_gru).

Instructions

100 XP
  • Import Dense and TimeDistributed layers from Keras.
  • Define a Dense layer with softmax activation which has fr_vocab outputs.
  • Wrap the Dense layer in a TimeDistributed layer.
  • Get the final prediction of the model by passing de_out to the de_dense_time layer.