Session Ready
Exercise

Building the decoder

In the previous exercise, you have built the encoder. You'll build the decoder now. Recall that the input to the encoder-decoder network is the set of prefixes and the goal is to generate the set of suffixes. The encoder processes the prefix sequences and summarizes the information in its internal state vectors. The decoder takes the initial states from the encoder, and its output is the set of target sequences which are the suffixes in this case. During training, the input to the decoder will also be the suffix sentences because of teacher-forcing.

You'll build the decoder using Keras. The Input, LSTM and Dense layers are already imported from keras.layers. The vocabulary is saved in vocabulary.

Instructions
100 XP
  • Create Input layer followed by an LSTM layer of 256 units.
  • Pass decoder_input and encoder_states in decoder_LSTM() to get the output.
  • Create the Dense layer with 'softmax' activation.
  • Pass decoder LSTM output to the dense layer to generate output.