Session Ready
Exercise

Create LSTM model in keras

In the previous exercise, you completed all the preprocessing of the dataset needed to train a neural network. You have the input and target vectors created. Now let's build the LSTM network which can be trained using these input and target vectors.

The Sequential model is already imported from keras.models. The Dense and LSTM layers are also imported from keras.layers. The vocabulary and the length of each sequence are saved in vocabulary and maxlen respectively.

Instructions 1/2
undefined XP
  • 1
  • 2
  • Create a Sequential model.
  • Add an LSTM layer of size 128 with input shape (maxlen, len(vocabulary)).
  • Add a Dense layer with 'softmax' activation.