Compiling the LSTM network model

For compiling the LSTM network model, we will use the following code:

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

We are using rmsprop as optimizer and binary_crossentropy for loss, since movie reviews have a binary response or, in other words, they are either positive or negative. For metrics, we are making use of classification accuracy. After compiling the model, we are ready to go to the next step of fitting the LSTM model.

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

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