Session Ready
Exercise

Define the input and target vectors

In this exercise, you'll use the vocabulary and the character to integer mapping to create the input and target tensors. First, you'll find out the length of the longest prefix and suffix which will give you the number of time-steps for the input and target data. Next, you'll create three-dimensional tensors for the input and the target vector.

The prefix and suffix sentences are available in prefix_sentences and suffix_sentences respectively. The vocabulary, character to integer and integer to character mappings are available in vocabulary, char_to_idx and idx_to_char respectively.

Instructions 1/2
undefined XP
  • 1
    • Find the length of the longest prefix and suffix.
    • 2
      • Define a 3-D zero vector for the encoded prefix, suffix and target sentences.