Number of units in the simple RNN layer

The code for incorporating this change and then compiling/fitting the model is as follows:

# Model architecturemodel <- keras_model_sequential() model %>%          layer_embedding(input_dim = 500, output_dim = 32) %>%         layer_simple_rnn(units = 32) %>%          layer_dense(units = 1, activation = "sigmoid")# Compile modelmodel %>% compile(optimizer = "rmsprop",         loss = "binary_crossentropy",         metrics = c("acc"))# Fit modelmodel_two <- model %>% fit(train_x, train_y,         epochs = 10,         batch_size = 128,         validation_split = 0.2)

Here, we change the architecture by increasing the number of units in the simple RNN layer from 8 to 32. Everything else is kept the same. Then, we compile and fit the model, as shown in the preceding code. ...

Get Advanced Deep Learning with R now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.