From the course: Deep Learning with Python and Keras: Build a Model for Sentiment Analysis

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Training a recurrent neural network

Training a recurrent neural network

- [Instructor] In this movie, we'll see how we can train our model using a simple recurrent neural network. We continue using the same vectorized layer to generate input sequences of integers to represent our input text, and we'll use an embeddings layer to generate embeddings. You'll see that recurrent neural networks may be conceptually hard to understand, but Keras and TensorFlow make it very easy for us to set up these RNNs. Now, the embedding dimensions I'm using for the embedding layer is a little larger. I've chosen 128. I want to see whether this larger dimensionality for the embeddings helps improve the performance of this model. We then instantiate a sequential model. The first layer that I add to this model is an embedding layer. Input dimensions equal to work cap size, output dimensions equal to embedding dimensions. The output of the embeddings layer will feed into our recurrent neural network. Simply…

Contents