August 2018
Intermediate to advanced
378 pages
9h 9m
English
Gated recurrent units (GRUs) are similar to LSTM cells but simpler. They have one gate that combines the forget and input gates in LSTM, and there is no output gate. While GRUs are simpler than LSTMs and therefore quicker to train, it is a matter of debate on whether they are better than LSTMs, as the research is inconclusive. Therefore, it is recommended to try both, as the results of your task may vary. The code for our GRU model is in Chapter7/classify_keras5.R. The parameters for the model are max length=150, the size of the embedding layer=32, and the model was trained for 10 epochs:
word_index <- dataset_reuters_word_index()max_features <- length(word_index)maxlen <- 250skip_top = 0...........model <- keras_model_sequential() ...
Read now
Unlock full access