logo

Crowdly

You want to train a simple RNN next-character prediction model on the sample tex...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

You want to train a simple RNN next-character prediction model on the sample text:

The model should predict the most likely character given a sequence of previous characters:

  1. Show the process of data preparation step by step and demonstrate how to encode it using one-hot encoding. Ensure that all steps are clearly shown. Half marks will be awarded if the workings are not provided. [20 marks]
  2. Using a window size of 5, generate and illustrate your training and target (labels) datasets for model training. Display only the first and last elements of each. What are the shapes of the x_train and y_train? [15 marks]
  3. Comment on using the categorical_crossentropy as your loss function for model training. Is ReLU a good activation function for this problem and why? [5 marks]

Note! It is acceptable to use shortcuts for displaying answers. For example, instead of showing the full vector like [0 0 0 0 0 0 0 0 0 0 0 0], you can represent it as [0 0 0 .... 0], and indicate that the vector has 12 elements of 0s.

More questions like this

Want instant access to all verified answers on moodle.kent.ac.uk?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!