Session Ready
Exercise

Predict the first character using inference models

Now that your inference models for the encoder and the decoder are ready, you can use them for predictions. You'll generate the suffix sentence character by character. Every time you feed a prefix to the inference model, it'll come up with the most probable next character for that prefix. In this exercise, you'll input one incomplete sentence to the encoder inference model and the start token to the decoder inference model and generate the next character in the sequence.

The encoder and decoder inference models are available in encoder_model_inf and decoder_model_inf respectively. The prefix input vector, the vocabulary, the character to integer and the integer to character mappings are available in input_data_prefix, vocabulary, char_to_idx and idx_to_char.

Instructions
100 XP
  • Use .predict() on encoder_model_inf to get the internal states of the Encoder.
  • Use .predict() on decoder_model_inf to get the output from the Decoder.
  • Get the most probable next character using the index to character mapping.