Session Ready
Exercise

Train LSTM model

In the last lesson, you pre-processed a dataset of selected literary works of Shakespeare so that it can be used to train an LSTM model to generate texts that imitate Shakespeare's unique writing style. You created the input and target vectors. You also built and compiled the LSTM network.

Now, you'll train this model using the input and target vectors. In this exercise, you'll train the model for only 1 epoch to save time. For a better prediction performance, you should train the model for more epochs with a bigger dataset. A more complex model with more hidden layers and more nodes in each layer would perform way better than this basic model.

The compiled model is available in the variable model. The input and target vectors are saved in x and y respectively.

Instructions
100 XP
  • Fit the model for 1 epoch using a batch size of 64 and a validation split of 0.2.