Compiling the model

 The code for compiling the model is as follows: 

# Compile model
model %>% compile(optimizer = "rmsprop",
loss = "binary_crossentropy",
metrics = c("acc"))

We compile the model with the rmsprop optimizer, which is recommended for recurrent neural networks. We make use of binary_crossentropy as the loss function due to a binary type of response since movie reviews are either positive or negative. Finally, for metrics, we have specified accuracy.

In the next section, we will use this architecture to develop a movie review sentiment classification model that uses recurrent neural networks.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset