February 2020
Intermediate to advanced
328 pages
8h 19m
English
In this section, we will work with the IMDb reviews dataset. The data preparation steps for this are the same as they were for the Sentiment classification using RNNs section. This means we can move straight onto the model-building part:
model <- keras_model_sequential()
model %>% layer_embedding(input_dim = 2000, output_dim = 128) %>% bidirectional(layer_simple_rnn(units = 32),merge_mode = "concat") %>% layer_dense(units = 1, activation = 'sigmoid') summary(model)
The following screenshot shows the summary of the model:
# compile model model %>% compile( loss = "binary_crossentropy" ...
Read now
Unlock full access